[gtk+] x11: Use GDK error trapping code



commit e3206b9de4d1ff5cd2f4b678c095993716284a67
Author: Benjamin Otte <otte redhat com>
Date:   Tue Feb 12 18:48:09 2013 +0100

    x11: Use GDK error trapping code

 gdk/x11/xsettings-client.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index c693211..a54dbea 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -110,12 +110,6 @@ notify_changes (XSettingsClient *client,
     }
 }
 
-static int
-ignore_errors (Display *display, XErrorEvent *event)
-{
-  return True;
-}
-
 #define BYTES_LEFT(buffer) ((buffer)->data + (buffer)->len - (buffer)->pos)
 
 static XSettingsResult
@@ -370,20 +364,18 @@ read_settings (XSettingsClient *client)
   unsigned char *data;
   int result;
 
-  int (*old_handler) (Display *, XErrorEvent *);
-  
   GHashTable *old_list = client->settings;
 
   client->settings = NULL;
 
   if (client->manager_window)
     {
-      old_handler = XSetErrorHandler (ignore_errors);
+      gdk_x11_display_error_trap_push (gdk_screen_get_display (client->screen));
       result = XGetWindowProperty (client->display, client->manager_window,
                                   client->xsettings_atom, 0, LONG_MAX,
                                   False, client->xsettings_atom,
                                   &type, &format, &n_items, &bytes_after, &data);
-      XSetErrorHandler (old_handler);
+      gdk_x11_display_error_trap_pop_ignored (gdk_screen_get_display (client->screen));
       
       if (result == Success && type != None)
        {


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