diff options
author | raveit65 <[email protected]> | 2018-06-07 19:11:55 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-06-10 14:32:25 +0200 |
commit | 4facc83230086b6ebfd4a325e179b8d8efae74e8 (patch) | |
tree | 813922759724e29ee12d84f01a0258ac6fa19c75 /capplets/mouse/msd-input-helper.c | |
parent | e19868df37c998909eeb62096d563dfc4afb810c (diff) | |
download | mate-control-center-4facc83230086b6ebfd4a325e179b8d8efae74e8.tar.bz2 mate-control-center-4facc83230086b6ebfd4a325e179b8d8efae74e8.tar.xz |
msd-input-helper: replace deprecated gdk_error_trap functions
Diffstat (limited to 'capplets/mouse/msd-input-helper.c')
-rw-r--r-- | capplets/mouse/msd-input-helper.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/capplets/mouse/msd-input-helper.c b/capplets/mouse/msd-input-helper.c index ae64b0d2..7dc0d996 100644 --- a/capplets/mouse/msd-input-helper.c +++ b/capplets/mouse/msd-input-helper.c @@ -44,39 +44,43 @@ static gboolean device_has_property (XDevice *device, const char *property_name) { + GdkDisplay *display; Atom realtype, prop; int realformat; unsigned long nitems, bytes_after; unsigned char *data; - prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), property_name, True); + display = gdk_display_get_default (); + prop = XInternAtom (GDK_DISPLAY_XDISPLAY (display), property_name, True); if (!prop) return FALSE; - gdk_error_trap_push (); - if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, prop, 0, 1, False, + gdk_x11_display_error_trap_push (display); + if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (display), device, prop, 0, 1, False, XA_INTEGER, &realtype, &realformat, &nitems, &bytes_after, &data) == Success) && (realtype != None)) { - gdk_error_trap_pop_ignored (); + gdk_x11_display_error_trap_pop_ignored (display); XFree (data); return TRUE; } - gdk_error_trap_pop_ignored (); + gdk_x11_display_error_trap_pop_ignored (display); return FALSE; } XDevice* device_is_touchpad (XDeviceInfo *deviceinfo) { + GdkDisplay *display; XDevice *device; - if (deviceinfo->type != XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XI_TOUCHPAD, True)) + display = gdk_display_get_default (); + if (deviceinfo->type != XInternAtom (GDK_DISPLAY_XDISPLAY (display), XI_TOUCHPAD, True)) return NULL; - gdk_error_trap_push (); - device = XOpenDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), deviceinfo->id); - if (gdk_error_trap_pop () || (device == NULL)) + gdk_x11_display_error_trap_push (display); + device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), deviceinfo->id); + if (gdk_x11_display_error_trap_pop (display) || (device == NULL)) return NULL; if (device_has_property (device, "libinput Tapping Enabled") || @@ -84,7 +88,7 @@ device_is_touchpad (XDeviceInfo *deviceinfo) return device; } - XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device); + XCloseDevice (GDK_DISPLAY_XDISPLAY (display), device); return NULL; } |