summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-11-16 14:02:19 +0100
committerWolfgang Ulbrich <[email protected]>2015-12-02 12:54:10 +0100
commit8ea8868b6e6cfa626905b52b4b94b10b60d43139 (patch)
tree8b280cf03d6569a1991f82b3449f8714bd31ebed /plugins
parentef58118cad934b5fa5bf5ca1abe2d7f3d6f56836 (diff)
downloadmate-settings-daemon-8ea8868b6e6cfa626905b52b4b94b10b60d43139.tar.bz2
mate-settings-daemon-8ea8868b6e6cfa626905b52b4b94b10b60d43139.tar.xz
GTK3: use gdk_error_trap_pop_ignored() when appropriate
taken from: https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=544526d
Diffstat (limited to 'plugins')
-rw-r--r--plugins/a11y-keyboard/msd-a11y-keyboard-manager.c12
-rw-r--r--plugins/clipboard/msd-clipboard-manager.c12
-rw-r--r--plugins/common/msd-input-helper.c9
-rw-r--r--plugins/keybindings/msd-keybindings-manager.c4
-rw-r--r--plugins/keyboard/msd-keyboard-manager.c4
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c4
-rw-r--r--plugins/mouse/msd-mouse-manager.c8
-rw-r--r--plugins/xrandr/msd-xrandr-manager.c16
8 files changed, 69 insertions, 0 deletions
diff --git a/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
index 7696d16..0d7f926 100644
--- a/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
@@ -185,7 +185,11 @@ get_xkb_desc_rec (MsdA11yKeyboardManager *manager)
desc->ctrls = NULL;
status = XkbGetControls (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), XkbAllControlsMask, desc);
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->ctrls != NULL, NULL);
@@ -392,7 +396,11 @@ set_server_from_settings (MsdA11yKeyboardManager *manager)
XkbFreeKeyboard (desc, XkbAllComponentsMask, True);
XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), FALSE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
mate_settings_profile_end (NULL);
}
@@ -1073,7 +1081,11 @@ restore_server_xkb_config (MsdA11yKeyboardManager *manager)
XkbAllComponentsMask, True);
XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), FALSE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
manager->priv->original_xkb_desc = NULL;
}
diff --git a/plugins/clipboard/msd-clipboard-manager.c b/plugins/clipboard/msd-clipboard-manager.c
index 93b1858..770cfe7 100644
--- a/plugins/clipboard/msd-clipboard-manager.c
+++ b/plugins/clipboard/msd-clipboard-manager.c
@@ -151,7 +151,11 @@ send_selection_notify (MsdClipboardManager *manager,
(XEvent *)&notify);
XSync (manager->priv->display, False);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
static void
@@ -178,7 +182,11 @@ finish_selection_request (MsdClipboardManager *manager,
False, NoEventMask, (XEvent *) &notify);
XSync (manager->priv->display, False);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
static int
@@ -554,7 +562,11 @@ convert_clipboard_target (IncrConversion *rdata,
XSync (manager->priv->display, False);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
}
}
diff --git a/plugins/common/msd-input-helper.c b/plugins/common/msd-input-helper.c
index 5043e35..d663afe 100644
--- a/plugins/common/msd-input-helper.c
+++ b/plugins/common/msd-input-helper.c
@@ -22,6 +22,7 @@
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
#include <sys/types.h>
#include <X11/Xatom.h>
@@ -65,11 +66,19 @@ device_is_touchpad (XDeviceInfo deviceinfo)
if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, prop, 0, 1, False,
XA_INTEGER, &realtype, &realformat, &nitems,
&bytes_after, &data) == Success) && (realtype != None)) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
XFree (data);
return device;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device);
return NULL;
diff --git a/plugins/keybindings/msd-keybindings-manager.c b/plugins/keybindings/msd-keybindings-manager.c
index c4fd858..e73f57e 100644
--- a/plugins/keybindings/msd-keybindings-manager.c
+++ b/plugins/keybindings/msd-keybindings-manager.c
@@ -330,7 +330,11 @@ binding_unregister_keys (MsdKeybindingsManager *manager)
if (need_flush)
gdk_flush ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
static void
diff --git a/plugins/keyboard/msd-keyboard-manager.c b/plugins/keyboard/msd-keyboard-manager.c
index 8d261b6..8558a54 100644
--- a/plugins/keyboard/msd-keyboard-manager.c
+++ b/plugins/keyboard/msd-keyboard-manager.c
@@ -312,7 +312,11 @@ apply_settings (GSettings *settings,
#endif /* HAVE_X11_EXTENSIONS_XKB_H */
XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), FALSE);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
void
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index 24b32ec..d34e50b 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -1204,7 +1204,11 @@ msd_media_keys_manager_stop (MsdMediaKeysManager *manager)
if (need_flush)
gdk_flush ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
g_slist_free (priv->screens);
priv->screens = NULL;
diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c
index a198b7c..4bcaabc 100644
--- a/plugins/mouse/msd-mouse-manager.c
+++ b/plugins/mouse/msd-mouse-manager.c
@@ -302,7 +302,11 @@ touchpad_has_single_button (XDevice *device)
if (rc == Success)
XFree (data);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
return is_single_button;
}
@@ -568,7 +572,11 @@ set_middle_button (MsdMouseManager *manager,
XChangeDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
device, prop, type, format, PropModeReplace, data, nitems);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
XFree (data);
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
index 45b243f..d77e12c 100644
--- a/plugins/xrandr/msd-xrandr-manager.c
+++ b/plugins/xrandr/msd-xrandr-manager.c
@@ -2381,7 +2381,11 @@ msd_xrandr_manager_start (MsdXrandrManager *manager,
True, GrabModeAsync, GrabModeAsync);
gdk_flush ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
if (manager->priv->rotate_windows_keycode) {
@@ -2393,7 +2397,11 @@ msd_xrandr_manager_start (MsdXrandrManager *manager,
True, GrabModeAsync, GrabModeAsync);
gdk_flush ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
show_timestamps_dialog (manager, "Startup");
@@ -2432,7 +2440,11 @@ msd_xrandr_manager_stop (MsdXrandrManager *manager)
manager->priv->switch_video_mode_keycode, AnyModifier,
gdk_x11_get_default_root_xwindow());
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
if (manager->priv->rotate_windows_keycode) {
@@ -2442,7 +2454,11 @@ msd_xrandr_manager_stop (MsdXrandrManager *manager)
manager->priv->rotate_windows_keycode, AnyModifier,
gdk_x11_get_default_root_xwindow());
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_error_trap_pop_ignored ();
+#else
gdk_error_trap_pop ();
+#endif
}
gdk_window_remove_filter (gdk_get_default_root_window (),