From 989f9630a43fe0c6efab64ea36e8a0e909d97c19 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 11 Jun 2015 21:10:28 -0400 Subject: [PATCH] input-settings-x11: Use xcb to change input settings This way, we won't be hit with BadValue errors if we set it to a value outside the X device's range. This can happen for touchpads without two-finger scrolling, for instance. --- configure.ac | 1 + src/backends/x11/meta-input-settings-x11.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 88d162a5c..b089a6616 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,7 @@ MUTTER_PC_MODULES=" xrender x11-xcb xcb-randr + xcb-xinput " GLIB_GSETTINGS diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c index f683c4788..a1b46dded 100644 --- a/src/backends/x11/meta-input-settings-x11.c +++ b/src/backends/x11/meta-input-settings-x11.c @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include @@ -78,6 +80,7 @@ change_property (ClutterInputDevice *device, { MetaBackend *backend = meta_get_backend (); Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend)); + xcb_connection_t *xcb_conn = XGetXCBConnection (xdisplay); int device_id; Atom property_atom; guchar *data_ret; @@ -89,8 +92,9 @@ change_property (ClutterInputDevice *device, if (!data_ret) return; - XIChangeProperty (xdisplay, device_id, property_atom, type, - format, XIPropModeReplace, data, nitems); + xcb_input_xi_change_property (xcb_conn, device_id, XCB_PROP_MODE_REPLACE, + format, property_atom, type, + nitems, data); meta_XFree (data_ret); }