GNOME Bugzilla – Bug 786365
Wrong Z-order by XReconfigureWMWindow() call
Last modified: 2017-09-29 16:36:42 UTC
Created attachment 357718 [details] Testprogram While adapting MSEide+MSEgui https://sourceforge.net/projects/mseide-msegui/ to Gnome I found on OpenSUSE Leap 42.2 that in XReconfigureWMWindow() call stackmode "Below" windows are placed at the bottom of the window stack instead just below the sibling, see test program. This makes it impossible for clients to reliably set the window stacking order. https://tronche.com/gui/x/xlib/window/c ... dowChanges " If a sibling and a stack_mode are specified, the window is restacked as follows: Above The window is placed just above the sibling. Below The window is placed just below the sibling. "
Fixed link: https://tronche.com/gui/x/xlib/window/configure.html#XWindowChanges
Created attachment 358747 [details] [review] x11/window: Respect XConfigureRequestEvent sibling This patch requires patch of issue#786363 comment#4, which was already reviewed. I also cross-posted the patch in that bug as comment#6, as they are related.
Created attachment 360247 [details] Testprogram 2 The first test program runs OK now, thanks. There is another problem see zorder1.c. The topleft black window should toggle Z-order between top and between the white and the other black window. That works on KDE, on Gnome the white window becomes the top level window.
Created attachment 360617 [details] [review] x11/window: Implement _NET_RESTACK_WINDOW and XConfigureRequestEvent sibling Updated patch with fix for the testcase of comment#3. This patch covers both this bug and bug#786363. Posted to both bugs for completion.
Review of attachment 360617 [details] [review]: looks mostly good, just a couple of comments: ::: src/x11/window-x11.c @@ +2192,3 @@ + display = meta_window_get_display (window); + sibling = meta_display_lookup_x_window (display, + event->xconfigurerequest.above); meta_display_lookup_x_window() may fail and return NULL which will make us crash on the sibling->desc dereference below if this happens I'd say we should return since the app is either buggy or malicious and so we should not restack it @@ +2281,3 @@ + if (window) + { + if (event->xclient.data.l[1]) the wm spec says "It should be used only by pagers, applications can use normal ConfigureRequests. The source indication field should be therefore set to 2" so I think we should enforce that here
*** Bug 786363 has been marked as a duplicate of this bug. ***
Created attachment 360670 [details] [review] x11/window: Implement _NET_RESTACK_WINDOW and XConfigureRequestEvent sibling Thanks for the review. New patch attached. Changes: - if sibling == NULL in meta_window_x11_configure_request(), simply return TRUE. - ignore NET_RESTACK_WINDOW if event->xclient.data.l[0] != 2 i.e. if event is not coming from a pager
Review of attachment 360670 [details] [review]: looks good, thanks for the patch, I'll push it with a few indentation fixes
Attachment 360670 [details] pushed as e3d5983 - x11/window: Implement _NET_RESTACK_WINDOW and XConfigureRequestEvent sibling