From 3e76033cd5ba2e18c4e155a201062b3a774ddd51 Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Sun, 29 Nov 2009 11:21:11 +0200 Subject: [PATCH] Do not minimize window when workspace changes When we have the systray icon enabled, any window visibility event seems to have WINDOW_STATE_ICONIFIED bit on. By checking both _ICONIFIED and _WITHDRAWN the behaviour appears nicer. --- pyfpdb/fpdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 80d3fb93..77f13ca7 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -669,8 +669,8 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") sys.stderr.write("fpdb starting ...") def window_state_event_cb(self, window, event): - print "window_state_event", event - if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED: + print "window_state_event: %s, mask=%s" % (event, event.changed_mask) + if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED & gtk.gdk.WINDOW_STATE_WITHDRAWN: # -20 = GWL_EXSTYLE can't find it in the pywin32 libs #bits = win32api.GetWindowLong(self.window.window.handle, -20) #bits = bits ^ (win32con.WS_EX_TOOLWINDOW | win32con.WS_EX_APPWINDOW)