Skip to content

Commit b73a008

Browse files
committed
mintUpdate.py: Fix tray re-activation in Wayland.
window.get_state() & Gdk.WindowState.FOCUSED is not reliable in Gtk3, and is not un-set when the underlying resources are destroyed (which happens when the window is 'closed to the tray'. When the user clicks the icon to show the window after 'closing' it, it still thinks it's focused, and attempts to hide again. Use window.is_active() instead, which is updated reliably (and is what we use in Warpinator for the same purpose).
1 parent c47be3d commit b73a008

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

usr/lib/linuxmint/mintUpdate/mintUpdate.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,12 +1353,7 @@ def add_to_ignore_list(self, widget, source_packages, versioned):
13531353
######### SYSTRAY #########
13541354

13551355
def tray_activate(self, time=0):
1356-
try:
1357-
focused = self.ui_window.get_window().get_state() & Gdk.WindowState.FOCUSED
1358-
except:
1359-
focused = self.ui_window.is_active() and self.ui_window.get_visible()
1360-
1361-
if focused:
1356+
if self.ui_window.is_active():
13621357
self.save_window_size()
13631358
self.hide_window()
13641359
else:

0 commit comments

Comments
 (0)