Skip to content
Permalink
Browse files

mouse: replace deprecated gdk_error_trap functions

  • Loading branch information...
raveit65 committed Jun 7, 2018
1 parent 5043569 commit e19868df37c998909eeb62096d563dfc4afb810c
Showing with 11 additions and 9 deletions.
  1. +11 −9 capplets/mouse/mate-mouse-properties.c
@@ -175,30 +175,32 @@ orientation_radio_button_toggled (GtkToggleButton *togglebutton,
static void
synaptics_check_capabilities (GtkBuilder *dialog)
{
GdkDisplay *display;
int numdevices, i;
XDeviceInfo *devicelist;
Atom realtype, prop;
int realformat;
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);
}

0 comments on commit e19868d

Please sign in to comment.
You can’t perform that action at this time.