diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-12-10 20:36:09 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-12-10 20:36:09 +0100 |
commit | 7b6b7b641c8a33703692333bfeccd87238ae1c73 (patch) | |
tree | 9850a81f7c33af6b388a3254a4d655a7fb9d2d27 | |
parent | b2cfa83c0cff0211ac63356fe16cd2ad2144bd91 (diff) | |
download | mate-screensaver-7b6b7b641c8a33703692333bfeccd87238ae1c73.tar.bz2 mate-screensaver-7b6b7b641c8a33703692333bfeccd87238ae1c73.tar.xz |
GTK3: use new gdk_error_trap_ignored api
This gets rid of some compile warnings
taken from:
https://git.gnome.org/browse/gnome-screensaver/commit/?id=73c0e41
-rw-r--r-- | src/gs-grab-x11.c | 22 | ||||
-rw-r--r-- | src/gs-window-x11.c | 12 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c index 83b04e0..7367034 100644 --- a/src/gs-grab-x11.c +++ b/src/gs-grab-x11.c @@ -121,7 +121,11 @@ xorg_lock_smasher_set_active (GSGrab *grab, status = XF86MiscSetGrabKeysState (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), active); gdk_display_sync (gdk_display_get_default ()); +#if GTK_CHECK_VERSION (3, 0, 0) + error = gdk_error_trap_pop (); +#else gdk_error_trap_pop (); +#endif if (active && status == MiscExtGrabStateAlready) { @@ -129,12 +133,26 @@ xorg_lock_smasher_set_active (GSGrab *grab, status = MiscExtGrabStateSuccess; } +#if GTK_CHECK_VERSION (3, 0, 0) + 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 gs_debug ("XF86MiscSetGrabKeysState(%s) returned %s\n", active ? "on" : "off", (status == MiscExtGrabStateSuccess ? "MiscExtGrabStateSuccess" : status == MiscExtGrabStateLocked ? "MiscExtGrabStateLocked" : status == MiscExtGrabStateAlready ? "MiscExtGrabStateAlready" : "unknown value")); +#endif } #else static void @@ -416,8 +434,12 @@ gs_grab_nuke_focus (void) XGetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &focus, &rev); XSetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), None, RevertToNone, CurrentTime); +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_error_trap_pop_ignored (); +#else gdk_display_sync (gdk_display_get_default ()); gdk_error_trap_pop (); +#endif } void diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c index caf673f..ee7b197 100644 --- a/src/gs-window-x11.c +++ b/src/gs-window-x11.c @@ -282,8 +282,12 @@ widget_clear_all_children (GtkWidget *widget) clear_children (GDK_WINDOW_XID (w)); +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_error_trap_pop_ignored (); +#else gdk_display_sync (gtk_widget_get_display (widget)); gdk_error_trap_pop (); +#endif } #endif @@ -1031,8 +1035,12 @@ select_popup_events (void) events = SubstructureNotifyMask | attr.your_event_mask; XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), events); +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_error_trap_pop_ignored (); +#else gdk_display_sync (gdk_display_get_default ()); gdk_error_trap_pop (); +#endif } static void @@ -1049,9 +1057,13 @@ 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); } +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_error_trap_pop_ignored (); +#else gdk_display_sync (gdk_display_get_default ()); gdk_error_trap_pop (); #endif +#endif } static void |