[Xfce4-commits] [xfce/xfwm4] 03/03: Search harder for screen for a window

noreply at xfce.org noreply at xfce.org
Tue Mar 10 22:14:19 CET 2015


This is an automated email from the git hooks/post-receive script.

olivier pushed a commit to branch xfce-4.12
in repository xfce/xfwm4.

commit 5850dd022c1da7ee7b81443ac714012520dfc226
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Mar 10 21:56:20 2015 +0100

    Search harder for screen for a window
    
    Bug: 11664
    
    _NET_REQUEST_FRAME_EXTENTS is a request sent before the window is mapped
    (it's the actual purpose, estimate what the frame extents will be once
    it's mapped), but as the window is not yet mapped, it is unknown to the
    window manager.
    
    That would cause _NET_REQUEST_FRAME_EXTENTS to be ignored, and some
    apps/tookit (namely GLFW) rely on it and would block indefinitely until
    the reply from the window manager is received.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/display.c |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/display.c b/src/display.c
index e676fe1..a1cfb02 100644
--- a/src/display.c
+++ b/src/display.c
@@ -619,15 +619,25 @@ myDisplayGetRootFromWindow(DisplayInfo *display, Window w)
 ScreenInfo *
 myDisplayGetScreenFromWindow (DisplayInfo *display, Window w)
 {
-    GSList *list;
+    ScreenInfo *screen;
+    Window root;
 
     g_return_val_if_fail (w != None, NULL);
     g_return_val_if_fail (display != NULL, NULL);
 
-    for (list = display->screens; list; list = g_slist_next (list))
+    /* First check if this is a known root window */
+    screen = myDisplayGetScreenFromRoot (display, w);
+    if (screen)
     {
-        ScreenInfo *screen = (ScreenInfo *) list->data;
-        if (screen->xroot == w)
+        return screen;
+    }
+
+    /* Else retrieve the window's root window */
+    root = myDisplayGetRootFromWindow (display, w);
+    if (root != None)
+    {
+        screen = myDisplayGetScreenFromRoot (display, root);
+        if (screen)
         {
             return screen;
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list