mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 18:40:40 -05:00
clutter: Extend touchpad device property check for Synaptics
So we reliably get CLUTTER_TOUCHPAD_DEVICE for those. The other heuristics to get the device type may fall short.
This commit is contained in:
parent
9c9551c1bd
commit
b4bb859a6a
@ -267,8 +267,9 @@ is_touch_device (XIAnyClassInfo **classes,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_touchpad_device (ClutterBackendX11 *backend_x11,
|
query_exists_device_property (ClutterBackendX11 *backend_x11,
|
||||||
XIDeviceInfo *info)
|
XIDeviceInfo *info,
|
||||||
|
const gchar *property)
|
||||||
{
|
{
|
||||||
gulong nitems, bytes_after;
|
gulong nitems, bytes_after;
|
||||||
guint32 *data = NULL;
|
guint32 *data = NULL;
|
||||||
@ -276,7 +277,7 @@ is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|||||||
Atom type;
|
Atom type;
|
||||||
Atom prop;
|
Atom prop;
|
||||||
|
|
||||||
prop = XInternAtom (backend_x11->xdpy, "libinput Tapping Enabled", True);
|
prop = XInternAtom (backend_x11->xdpy, property, True);
|
||||||
if (prop == None)
|
if (prop == None)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -297,6 +298,21 @@ is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
is_touchpad_device (ClutterBackendX11 *backend_x11,
|
||||||
|
XIDeviceInfo *info)
|
||||||
|
{
|
||||||
|
if (query_exists_device_property (backend_x11, info,
|
||||||
|
"libinput Tapping Enabled"))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (query_exists_device_property (backend_x11, info,
|
||||||
|
"Synaptics Off"))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
get_device_ids (ClutterBackendX11 *backend_x11,
|
get_device_ids (ClutterBackendX11 *backend_x11,
|
||||||
XIDeviceInfo *info,
|
XIDeviceInfo *info,
|
||||||
|
Loading…
Reference in New Issue
Block a user