openbsd-ports/x11/gpointing-device-settings/patches/patch-src_gpds-xinput_c
mpi 49ed4a3db3 Import gpointing-device-settings-1.5.1
GPointingDeviceSettings is a GUI tool for setting pointing device such
as TrackPoint or Touchpad. Each UI can be written as dynamic loadable
module, so a third party can add its own UI.

Based on a port from jasper@ with tweaks by ajacoutot@

ok ajacoutot@, jasper@
2011-08-31 15:15:25 +00:00

98 lines
4.0 KiB
Plaintext

$OpenBSD: patch-src_gpds-xinput_c,v 1.1.1.1 2011/08/31 15:15:25 mpi Exp $
Fix build with gtk+-2.22.
From https://bugzilla.gnome.org/show_bug.cgi?id=631068
--- src/gpds-xinput.c.orig Tue Jan 19 11:01:30 2010
+++ src/gpds-xinput.c Mon Jan 17 14:42:04 2011
@@ -99,7 +99,7 @@ dispose (GObject *object)
g_free(priv->device_name);
if (priv->device) {
- XCloseDevice(GDK_DISPLAY(), priv->device);
+ XCloseDevice(gdk_x11_get_default_xdisplay(), priv->device);
priv->device = NULL;
}
@@ -193,7 +193,8 @@ get_x_error_text (int x_error_code)
{
gchar buf[64];
- XGetErrorText(GDK_DISPLAY(), x_error_code, buf, sizeof(buf) - 1);
+ XGetErrorText(gdk_x11_get_default_xdisplay(), x_error_code,
+ buf, sizeof(buf) - 1);
return g_strdup(buf);
}
@@ -267,7 +268,7 @@ gpds_xinput_set_int_properties_by_name_with_format_typ
}
gdk_error_trap_push();
- XChangeDeviceProperty(GDK_DISPLAY(),
+ XChangeDeviceProperty(gdk_x11_get_default_xdisplay(),
device, property_atom,
XA_INTEGER, format_type, PropModeReplace,
(unsigned char*)property_data, n_properties);
@@ -377,7 +378,8 @@ get_atom (GpdsXInput *xinput, const gchar *property_na
if (!device)
return -1;
- properties = XListDeviceProperties(GDK_DISPLAY(), device, &n_properties);
+ properties = XListDeviceProperties(gdk_x11_get_default_xdisplay(),
+ device, &n_properties);
for (i = 0; i < n_properties; i++) {
const gchar *name;
@@ -421,9 +423,9 @@ gpds_xinput_get_int_properties_by_name (GpdsXInput *xi
return FALSE;
gdk_error_trap_push();
- status = XGetDeviceProperty(GDK_DISPLAY(), device, atom, 0, 1000, False,
- XA_INTEGER, &actual_type, &actual_format,
- n_values, &bytes_after, &data);
+ status = XGetDeviceProperty(gdk_x11_get_default_xdisplay(), device, atom,
+ 0, 1000, False, XA_INTEGER, &actual_type,
+ &actual_format, n_values, &bytes_after, &data);
gdk_flush();
x_error_code = gdk_error_trap_pop();
if (status != Success || x_error_code != 0) {
@@ -517,7 +519,7 @@ gpds_xinput_set_float_properties_by_name (GpdsXInput *
*(property_data + i) = (gfloat)properties[i];
gdk_error_trap_push();
- XChangeDeviceProperty(GDK_DISPLAY(),
+ XChangeDeviceProperty(gdk_x11_get_default_xdisplay(),
device, property_atom,
float_atom, 32, PropModeReplace,
(unsigned char*)property_data, n_properties);
@@ -588,7 +590,8 @@ gpds_xinput_get_float_properties_by_name (GpdsXInput *
return FALSE;
gdk_error_trap_push();
- status = XGetDeviceProperty(GDK_DISPLAY(), device, property_atom, 0, 1000, False,
+ status = XGetDeviceProperty(gdk_x11_get_default_xdisplay(), device,
+ property_atom, 0, 1000, False,
float_atom, &actual_type, &actual_format,
n_properties, &bytes_after, &data);
gdk_flush();
@@ -670,7 +673,8 @@ gpds_xinput_get_button_map (GpdsXInput *xinput,
*map = g_new0(guchar, *n_buttons);
gdk_error_trap_push();
- status = XGetDeviceButtonMapping(GDK_DISPLAY(), device, *map, *n_buttons);
+ status = XGetDeviceButtonMapping(gdk_x11_get_default_xdisplay(),
+ device, *map, *n_buttons);
gdk_flush();
x_error_code = gdk_error_trap_pop();
@@ -699,7 +703,8 @@ gpds_xinput_set_button_map (GpdsXInput *xinput,
return FALSE;
gdk_error_trap_push();
- status = XSetDeviceButtonMapping(GDK_DISPLAY(), device, map, n_buttons);
+ status = XSetDeviceButtonMapping(gdk_x11_get_default_xdisplay(),
+ device, map, n_buttons);
gdk_flush();
x_error_code = gdk_error_trap_pop();