GNOME Bugzilla – Bug 752765
GtkWindow: queue states if not mapped not if not realized
Last modified: 2015-07-23 21:55:16 UTC
One of the commits fixing (or meant as cleanup maybe) bug 752742 broke maximizing GtkWindow in case it is realized but not mapped. Example: w = Gtk.Window() w.realize() w.maximize() w.show()
Created attachment 307973 [details] [review] GtkWindow: Make sure that we queue states when not mapped
Review of attachment 307973 [details] [review]: I guess thats almost right, except for one thing: in gtk_window_map, we also call gdk_window_maximize, before the window is shown. What gives ?
Good question. So the problem isn't that maximized is called when the GdkWindow isn't mapped as it queues those things by itself through the state member and calling set_initial_hints() when it is shown. The problem is that if maximize_initially = FALSE when GtkWindow is shown, it will call gdk_window_unmaximize(), undoing any maximize call forwarded directly to the GdkWindow from before. One solution would be add members like below_initially_set so we know there is something queued. Or revert your commit.
Created attachment 308034 [details] [review] Another fix for unmapped window states The previous fix was falling into the crack between realized and mapped - we would apply the state when a window is just realized, then unset the _initially flag, and then when the window gets mapped, we'd undo the state.
Does this work for you ?
If it's OK that the following fails, sure. w = Gtk.Window() w.realize() w.maximize() assert w.get_window().get_state() & Gdk.WindowState.MAXIMIZED w.show()
Attachment 308034 [details] pushed as 1138d4f - Another fix for unmapped window states