[gtk+] x11: Trap errors around an XRandr call



commit 832742e1f3b426329c843302c871903cd1f68a38
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 4 14:34:03 2016 -0500

    x11: Trap errors around an XRandr call
    
    Apparently, we can get X errors here. Ignore them.
    https://bugzilla.gnome.org/show_bug.cgi?id=762907

 gdk/x11/gdkscreen-x11.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 063b597..9d8ed20 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -649,10 +649,14 @@ init_randr15 (GdkScreen *screen)
   for (i = 0; i < num_rr_monitors; i++)
     {
       RROutput output = rr_monitors[i].outputs[0];
-      XRROutputInfo *output_info =
-        XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
+      XRROutputInfo *output_info;
       GdkX11Monitor monitor;
 
+      gdk_x11_display_error_trap_push (display);
+      output_info = XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
+      if (gdk_x11_display_error_trap_pop (display))
+        continue;
+
       if (output_info == NULL)
         continue;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]