Lines 99-105
Link Here
|
99 |
g_free(priv->device_name); |
99 |
g_free(priv->device_name); |
100 |
|
100 |
|
101 |
if (priv->device) { |
101 |
if (priv->device) { |
102 |
XCloseDevice(GDK_DISPLAY(), priv->device); |
102 |
XCloseDevice(gdk_x11_get_default_xdisplay(), priv->device); |
103 |
priv->device = NULL; |
103 |
priv->device = NULL; |
104 |
} |
104 |
} |
105 |
|
105 |
|
Lines 193-199
Link Here
|
193 |
{ |
193 |
{ |
194 |
gchar buf[64]; |
194 |
gchar buf[64]; |
195 |
|
195 |
|
196 |
XGetErrorText(GDK_DISPLAY(), x_error_code, buf, sizeof(buf) - 1); |
196 |
XGetErrorText(gdk_x11_get_default_xdisplay(), x_error_code, |
|
|
197 |
buf, sizeof(buf) - 1); |
197 |
|
198 |
|
198 |
return g_strdup(buf); |
199 |
return g_strdup(buf); |
199 |
} |
200 |
} |
Lines 267-273
Link Here
|
267 |
} |
268 |
} |
268 |
|
269 |
|
269 |
gdk_error_trap_push(); |
270 |
gdk_error_trap_push(); |
270 |
XChangeDeviceProperty(GDK_DISPLAY(), |
271 |
XChangeDeviceProperty(gdk_x11_get_default_xdisplay(), |
271 |
device, property_atom, |
272 |
device, property_atom, |
272 |
XA_INTEGER, format_type, PropModeReplace, |
273 |
XA_INTEGER, format_type, PropModeReplace, |
273 |
(unsigned char*)property_data, n_properties); |
274 |
(unsigned char*)property_data, n_properties); |
Lines 377-383
Link Here
|
377 |
if (!device) |
378 |
if (!device) |
378 |
return -1; |
379 |
return -1; |
379 |
|
380 |
|
380 |
properties = XListDeviceProperties(GDK_DISPLAY(), device, &n_properties); |
381 |
properties = XListDeviceProperties(gdk_x11_get_default_xdisplay(), |
|
|
382 |
device, &n_properties); |
381 |
for (i = 0; i < n_properties; i++) { |
383 |
for (i = 0; i < n_properties; i++) { |
382 |
const gchar *name; |
384 |
const gchar *name; |
383 |
|
385 |
|
Lines 421-429
Link Here
|
421 |
return FALSE; |
423 |
return FALSE; |
422 |
|
424 |
|
423 |
gdk_error_trap_push(); |
425 |
gdk_error_trap_push(); |
424 |
status = XGetDeviceProperty(GDK_DISPLAY(), device, atom, 0, 1000, False, |
426 |
status = XGetDeviceProperty(gdk_x11_get_default_xdisplay(), device, atom, |
425 |
XA_INTEGER, &actual_type, &actual_format, |
427 |
0, 1000, False, XA_INTEGER, &actual_type, |
426 |
n_values, &bytes_after, &data); |
428 |
&actual_format, n_values, &bytes_after, &data); |
427 |
gdk_flush(); |
429 |
gdk_flush(); |
428 |
x_error_code = gdk_error_trap_pop(); |
430 |
x_error_code = gdk_error_trap_pop(); |
429 |
if (status != Success || x_error_code != 0) { |
431 |
if (status != Success || x_error_code != 0) { |
Lines 517-523
Link Here
|
517 |
*(property_data + i) = (gfloat)properties[i]; |
519 |
*(property_data + i) = (gfloat)properties[i]; |
518 |
|
520 |
|
519 |
gdk_error_trap_push(); |
521 |
gdk_error_trap_push(); |
520 |
XChangeDeviceProperty(GDK_DISPLAY(), |
522 |
XChangeDeviceProperty(gdk_x11_get_default_xdisplay(), |
521 |
device, property_atom, |
523 |
device, property_atom, |
522 |
float_atom, 32, PropModeReplace, |
524 |
float_atom, 32, PropModeReplace, |
523 |
(unsigned char*)property_data, n_properties); |
525 |
(unsigned char*)property_data, n_properties); |
Lines 588-594
Link Here
|
588 |
return FALSE; |
590 |
return FALSE; |
589 |
|
591 |
|
590 |
gdk_error_trap_push(); |
592 |
gdk_error_trap_push(); |
591 |
status = XGetDeviceProperty(GDK_DISPLAY(), device, property_atom, 0, 1000, False, |
593 |
status = XGetDeviceProperty(gdk_x11_get_default_xdisplay(), device, |
|
|
594 |
property_atom, 0, 1000, False, |
592 |
float_atom, &actual_type, &actual_format, |
595 |
float_atom, &actual_type, &actual_format, |
593 |
n_properties, &bytes_after, &data); |
596 |
n_properties, &bytes_after, &data); |
594 |
gdk_flush(); |
597 |
gdk_flush(); |
Lines 670-676
Link Here
|
670 |
*map = g_new0(guchar, *n_buttons); |
673 |
*map = g_new0(guchar, *n_buttons); |
671 |
|
674 |
|
672 |
gdk_error_trap_push(); |
675 |
gdk_error_trap_push(); |
673 |
status = XGetDeviceButtonMapping(GDK_DISPLAY(), device, *map, *n_buttons); |
676 |
status = XGetDeviceButtonMapping(gdk_x11_get_default_xdisplay(), |
|
|
677 |
device, *map, *n_buttons); |
674 |
gdk_flush(); |
678 |
gdk_flush(); |
675 |
|
679 |
|
676 |
x_error_code = gdk_error_trap_pop(); |
680 |
x_error_code = gdk_error_trap_pop(); |
Lines 699-705
Link Here
|
699 |
return FALSE; |
703 |
return FALSE; |
700 |
|
704 |
|
701 |
gdk_error_trap_push(); |
705 |
gdk_error_trap_push(); |
702 |
status = XSetDeviceButtonMapping(GDK_DISPLAY(), device, map, n_buttons); |
706 |
status = XSetDeviceButtonMapping(gdk_x11_get_default_xdisplay(), |
|
|
707 |
device, map, n_buttons); |
703 |
gdk_flush(); |
708 |
gdk_flush(); |
704 |
|
709 |
|
705 |
x_error_code = gdk_error_trap_pop(); |
710 |
x_error_code = gdk_error_trap_pop(); |