diff options
author | raveit65 <[email protected]> | 2018-06-07 18:58:40 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-06-10 14:32:25 +0200 |
commit | e19868df37c998909eeb62096d563dfc4afb810c (patch) | |
tree | 83e19f57071e0b14b2f5af13d6586a48e0f686e9 /capplets | |
parent | 50435695c33cd9515d7719cb639d8d8aeb74782b (diff) | |
download | mate-control-center-e19868df37c998909eeb62096d563dfc4afb810c.tar.bz2 mate-control-center-e19868df37c998909eeb62096d563dfc4afb810c.tar.xz |
mouse: replace deprecated gdk_error_trap functions
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/mouse/mate-mouse-properties.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index 69e84a56..5fc3fee8 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -175,6 +175,7 @@ orientation_radio_button_toggled (GtkToggleButton *togglebutton, static void synaptics_check_capabilities (GtkBuilder *dialog) { + GdkDisplay *display; int numdevices, i; XDeviceInfo *devicelist; Atom realtype, prop; @@ -182,23 +183,24 @@ synaptics_check_capabilities (GtkBuilder *dialog) unsigned long nitems, bytes_after; unsigned char *data; - prop = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "Synaptics Capabilities", True); + display = gdk_display_get_default (); + prop = XInternAtom (GDK_DISPLAY_XDISPLAY(display), "Synaptics Capabilities", True); if (!prop) return; - devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), &numdevices); + devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY(display), &numdevices); for (i = 0; i < numdevices; i++) { if (devicelist[i].use != IsXExtensionPointer) continue; - gdk_error_trap_push (); - XDevice *device = XOpenDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), + gdk_x11_display_error_trap_push (display); + XDevice *device = XOpenDevice (GDK_DISPLAY_XDISPLAY(display), devicelist[i].id); - if (gdk_error_trap_pop ()) + if (gdk_x11_display_error_trap_pop (display)) continue; - gdk_error_trap_push (); - if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device, prop, 0, 2, False, + gdk_x11_display_error_trap_push (display); + if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY(display), device, prop, 0, 2, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { /* Property data is booleans for has_left, has_middle, @@ -211,9 +213,9 @@ synaptics_check_capabilities (GtkBuilder *dialog) XFree (data); } - gdk_error_trap_pop_ignored (); + gdk_x11_display_error_trap_pop_ignored (display); - XCloseDevice (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), device); + XCloseDevice (GDK_DISPLAY_XDISPLAY(display), device); } XFreeDeviceList (devicelist); } |