After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752765 - GtkWindow: queue states if not mapped not if not realized
GtkWindow: queue states if not mapped not if not realized
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.17.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-07-23 08:33 UTC by Christoph Reiter (lazka)
Modified: 2015-07-23 21:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkWindow: Make sure that we queue states when not mapped (3.36 KB, patch)
2015-07-23 08:33 UTC, Christoph Reiter (lazka)
reviewed Details | Review
Another fix for unmapped window states (7.20 KB, patch)
2015-07-23 20:27 UTC, Matthias Clasen
committed Details | Review

Description Christoph Reiter (lazka) 2015-07-23 08:33:37 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()
Comment 1 Christoph Reiter (lazka) 2015-07-23 08:33:58 UTC
Created attachment 307973 [details] [review]
GtkWindow: Make sure that we queue states when not mapped
Comment 2 Matthias Clasen 2015-07-23 18:56:37 UTC
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 ?
Comment 3 Christoph Reiter (lazka) 2015-07-23 20:10:07 UTC
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.
Comment 4 Matthias Clasen 2015-07-23 20:27:37 UTC
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.
Comment 5 Matthias Clasen 2015-07-23 20:28:09 UTC
Does this work for you ?
Comment 6 Christoph Reiter (lazka) 2015-07-23 20:37:16 UTC
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()
Comment 7 Matthias Clasen 2015-07-23 21:55:12 UTC
Attachment 308034 [details] pushed as 1138d4f - Another fix for unmapped window states