linuxmint / mintupdate

The Linux Mint Update Manager
320 stars 156 forks source link

Update manager cannot be opened following prior updates #712

Open JackNWhite opened 2 years ago

JackNWhite commented 2 years ago

Describe the bug Following some updates in mintupdate, after closing the main window, it cannot be reopened by clicking on the tray indicator and you must right-click on the icon, exit, and then restart mintupdate.

To Reproduce

  1. Make some updates
  2. Repeat 1 until the behaviour appears

Expected behavior I expect that, whenever I click on the mintupdate indicator icon, the main window will appear, and then disappear if I click again, ad infinitum.

Distribution: Linux Mint 20.2 Cinnamon

Software version: mintupdate 5.7.8

Logs: 11.26@18:37 ++ Launching Update Manager 11.26@18:37 ++ Changes to the package cache detected, triggering refresh 11.26@18:37 ++ Starting refresh (local only) 11.26@18:37 ++ Initial refresh will happen in 0 day(s), 0 hour(s) and 10 minute(s) 11.26@18:37 ++ System is up to date 11.26@18:37 ++ Refresh finished

Additional context I suspect that this happens when updating spices, and Cinnamon is restarted.

sbadux commented 2 years ago

Hello, I was trying to understand this bug but I've seen that some changes has been made in the code. v5.8.1 built from this github repository (instead of version 5.7.8 of the official repository) seems to fix this bug.

The code:

def tray_activate(self, time=0):
        if self.window.is_active():
            self.save_window_size()
            self.window.hide()
        else:
            self.window.show()
            self.window.present_with_time(time)

has been changed in:

def tray_activate(self, time=0):
        try:
            focused = self.window.get_window().get_state() & Gdk.WindowState.FOCUSED
        except:
            focused = self.window.is_active() and self.window.get_visible()

        if focused:
            self.save_window_size()
            self.window.hide()
        else:
            self.window.show()
            self.window.present_with_time(time)

This change is not made by me and it's already merged in the code so I don't know who should you thank :slightly_smiling_face:

I've tried to build the code downloaded from this github and it seems to work as expected.

JackNWhite commented 2 years ago

Thank you for the effort, @sbadux and whoever did the update!

nicolaasjan commented 2 years ago

I have version 5.8.1, but still have the same issue.