[gnome-screensaver] use new gdk_error_trap_ignored api



commit 73c0e41765abb16bd6743e446b758d36428b4d59
Author: Ray Strode <rstrode redhat com>
Date:   Thu Sep 30 01:14:47 2010 -0400

    use new gdk_error_trap_ignored api
    
    This gets rid of some compile warnings

 src/gs-grab-x11.c   |   22 +++++++++++++---------
 src/gs-visual-gl.c  |    3 +--
 src/gs-window-x11.c |    9 +++------
 3 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c
index 1ce940c..a8c1de0 100644
--- a/src/gs-grab-x11.c
+++ b/src/gs-grab-x11.c
@@ -111,19 +111,24 @@ xorg_lock_smasher_set_active (GSGrab  *grab,
         status = XF86MiscSetGrabKeysState (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), active);
 
         gdk_display_sync (gdk_display_get_default ());
-        gdk_error_trap_pop ();
+        error = gdk_error_trap_pop ();
 
         if (active && status == MiscExtGrabStateAlready) {
                 /* shut up, consider this success */
                 status = MiscExtGrabStateSuccess;
         }
 
-        gs_debug ("XF86MiscSetGrabKeysState(%s) returned %s\n",
-                  active ? "on" : "off",
-                  (status == MiscExtGrabStateSuccess ? "MiscExtGrabStateSuccess" :
-                   status == MiscExtGrabStateLocked  ? "MiscExtGrabStateLocked"  :
-                   status == MiscExtGrabStateAlready ? "MiscExtGrabStateAlready" :
-                   "unknown value"));
+        if (error == Success) {
+                gs_debug ("XF86MiscSetGrabKeysState(%s) returned %s\n",
+                          active ? "on" : "off",
+                          (status == MiscExtGrabStateSuccess ? "MiscExtGrabStateSuccess" :
+                           status == MiscExtGrabStateLocked  ? "MiscExtGrabStateLocked"  :
+                           status == MiscExtGrabStateAlready ? "MiscExtGrabStateAlready" :
+                           "unknown value"));
+        } else {
+                gs_debug ("XF86MiscSetGrabKeysState(%s) failed with error code %d\n",
+                          active ? "on" : "off", error);
+        }
 }
 #else
 static void
@@ -383,8 +388,7 @@ gs_grab_nuke_focus (void)
 
         XSetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), None, RevertToNone, CurrentTime);
 
-        gdk_display_sync (gdk_display_get_default ());
-        gdk_error_trap_pop ();
+        gdk_error_trap_pop_ignored ();
 }
 
 void
diff --git a/src/gs-visual-gl.c b/src/gs-visual-gl.c
index 7d3c04f..4bb77d6 100644
--- a/src/gs-visual-gl.c
+++ b/src/gs-visual-gl.c
@@ -100,8 +100,7 @@ gs_visual_gl_get_best_for_screen (GdkScreen *screen)
                 }
         }
 
-        gdk_display_sync (display);
-        gdk_error_trap_pop ();
+        gdk_error_trap_pop_ignored ();
 
 #else
         visual = NULL;
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 74822ed..2c9a63b 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -252,8 +252,7 @@ widget_clear_all_children (GtkWidget *widget)
 
         clear_children (GDK_WINDOW_XID (w));
 
-        gdk_display_sync (gtk_widget_get_display (widget));
-        gdk_error_trap_pop ();
+        gdk_error_trap_pop_ignored ();
 }
 
 void
@@ -848,8 +847,7 @@ select_popup_events (void)
         events = SubstructureNotifyMask | attr.your_event_mask;
         XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), events);
 
-        gdk_display_sync (gdk_display_get_default ());
-        gdk_error_trap_pop ();
+        gdk_error_trap_pop_ignored ();
 }
 
 static void
@@ -866,8 +864,7 @@ window_select_shape_events (GSWindow *window)
                 XShapeSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), events);
         }
 
-        gdk_display_sync (gdk_display_get_default ());
-        gdk_error_trap_pop ();
+        gdk_error_trap_pop_ignored ();
 #endif
 }
 



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