[Xfce4-commits] [xfce/xfwm4] 01/01: compositor: Disable XPresent on error

noreply at xfce.org noreply at xfce.org
Fri Jun 9 13:49:28 CEST 2017


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

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit 7d9e6ceda2d02b4f1f00ce70e86333317c3369a1
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Fri Jun 9 13:34:30 2017 +0200

    compositor: Disable XPresent on error
    
    Bug: 13607
    
    If XPresentPixmap() fails, we would disable Present rather that waiting
    for a notification that will never arrive.
    
    But that relies on the actual window to be reported in the XError, which
    is not necessarily the case.
    
    Disable Xpresent for all screens as we are not sure we can tell which
    one from the resource id.
---
 src/compositor.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index aaaaa63..43477e2 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1558,15 +1558,18 @@ present_error_handler (Display * dpy, XErrorEvent * err)
     g_return_val_if_fail (display_info, 0);
 
     /* XPresentPixmap() can trigger a BadWindow rather than a BadMatch */
-    if (err->request_code == display_info->present_opcode && err->error_code == BadWindow)
+    if (err->request_code == display_info->present_opcode &&
+        (err->error_code == BadWindow || err->error_code == BadMatch))
     {
-        ScreenInfo *screen_info;
-        screen_info = myDisplayGetScreenFromOutput (display_info, err->resourceid);
+        GSList *screens;
+
+        g_warning ("Dismissing XPresent as unusable, error %d for request %d",
+                    err->error_code, err->request_code);
 
-        if (screen_info != NULL)
+        for (screens = display_info->screens; screens; screens = g_slist_next (screens))
         {
-            g_warning ("Disabling XPresent, error %d on window 0x%lx for request %d",
-                       err->error_code, err->resourceid, err->request_code);
+            ScreenInfo *screen_info = ((ScreenInfo *) screens->data);
+
             screen_info->present_pending = FALSE;
             screen_info->use_present = FALSE;
         }

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


More information about the Xfce4-commits mailing list