GNOME Bugzilla – Bug 755606
Setting a parent/transient_for should affect the stack immediately
Last modified: 2015-12-23 07:32:45 UTC
Making a MetaWindow a parent of another MetaWindow by setting the 'transient_for' state only affects the stacking order at an arbitrary later point after the state was set (whenever the stacking constraints were processed after the connection was made). These patches fixes it and adds a test to tests/stacking/.
Created attachment 312099 [details] [review] window: Update the stack after setting the transient_for field Don't update the stack until after setting the window->transient_for field. Updating before will cause the stack transient-for constraint to be missing until the next time constraints are applied.
Created attachment 312100 [details] [review] tests: Add test for testing that setting a parent affects the stack A new test is added that tests that xdg_surface.set_parent (referred to as "transient for" in X11 terminology) affects the stack immediately.
Ping.
We might need this fix for bug 759161 as well.
Review of attachment 312099 [details] [review]: Seems obviously correct. But I'm curious, did you find a case where this was a problem in practice? What was it?
Review of attachment 312100 [details] [review]: looks fine ::: src/tests/test-client.c @@ +141,3 @@ + if (argc != 3) + { + g_print ("usage: menu <window-id> <parent-id>"); this should probably be "set_parent <client-id>/<window-id> <parent-id>"
(In reply to Rui Matos from comment #5) > Review of attachment 312099 [details] [review] [review]: > > Seems obviously correct. But I'm curious, did you find a case where this was > a problem in practice? What was it? If you have a existing window that is made a child window of some other window it wouldn't take effect until some other window stacking operation was done. The client I used where I hit this was my xdg-app portal-on-wayland proof of concept (https://github.com/jadahl/gtkforeign/ ).
... and gtk itself as well as this is required for bug 759161
(In reply to Rui Matos from comment #6) > Review of attachment 312100 [details] [review] [review]: > > looks fine > > ::: src/tests/test-client.c > @@ +141,3 @@ > + if (argc != 3) > + { > + g_print ("usage: menu <window-id> <parent-id>"); > > this should probably be "set_parent <client-id>/<window-id> <parent-id>" This is the usage of the test-client, which does not have the concept of "client id" since it is the client.
Attachment 312099 [details] pushed as 213f0fa - window: Update the stack after setting the transient_for field Attachment 312100 [details] pushed as 75b992c - tests: Add test for testing that setting a parent affects the stack