summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-08-22 13:01:03 +0200
committerraveit65 <[email protected]>2018-08-22 13:01:03 +0200
commit6ae456c59a6c8b230c4c8e96b49976ccd7ae0a47 (patch)
treecde2ea87db26b6fb3f83707a6ec8e9359e157318
parent3fe98d7d01238bfacd793110b4b2c8b9a8d93609 (diff)
downloadmate-settings-daemon-6ae456c59a6c8b230c4c8e96b49976ccd7ae0a47.tar.bz2
mate-settings-daemon-6ae456c59a6c8b230c4c8e96b49976ccd7ae0a47.tar.xz
msd-input-helper: replace deprecated gdk_error_trap_push/pop
-rw-r--r--plugins/common/msd-input-helper.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/common/msd-input-helper.c b/plugins/common/msd-input-helper.c
index ae64b0d..5434014 100644
--- a/plugins/common/msd-input-helper.c
+++ b/plugins/common/msd-input-helper.c
@@ -44,39 +44,45 @@ 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 +90,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;
}