GNOME Bugzilla – Bug 724951
gdk_window_get_state() returns old value after unmaximize
Last modified: 2014-03-21 22:32:37 UTC
Created attachment 269990 [details] gdk_window_get_state() test app It looks like the first call to gdk_window_get_state() returns the old value after an unmaximize. The simple testcase (attached) registers a callback and prints out window state and size. We geht: # Normal window state = 0x80, width = 200, height = 200 # Maximize state = 0x184, width = 1920, height = 1014 # Unmaximize state = 0x184, width = 200, height = 200 # Move window state = 0x80, width = 200, height = 200 Decode: 0x80 == GDK_WINDOW_STATE_FOCUSED 0x184 == GDK_WINDOW_STATE_FOCUSED | GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED Downstream user is Geary, where this behavoir makes Geary fail to restore the correct window state when the user unmaximizes, then closes the window.
I would recommend using window-state-event instead of configure for this kind of tracking.
Thanks for the suggestion. This works. Calling gdk_window_get_state() from within the callback is probably just a bad idea.