[gtk/gtk-3-24: 2/4] x11: don't add unknown tools to our list
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 2/4] x11: don't add unknown tools to our list
- Date: Tue, 18 Dec 2018 20:10:06 +0000 (UTC)
commit c6dd92294de2d9f07b12367ac6ead4f964cc92d3
Author: Peter Hutterer <peter hutterer who-t net>
Date: Fri Dec 14 14:57:26 2018 +1000
x11: don't add unknown tools to our list
Generic tools (Bamboo, built-in tablets) always have the same serial number
assigned by the wacom driver. This includes the touch tool when the wacom
driver handles the touch evdev node (common where users require the wacom
gestures to work).
When the first device is the touch device, a tool is created with that serial.
All future tools now return the touch tool on lookup since they all share the
same serial number. Worse, this happens *across* devices, so the pen
event node gets assigned the touch tool because they all have the same serial.
Since we don't actually care about the touch as a tool, let's skip any unknown
tool. This captures pads as well.
gdk/x11/gdkdevicemanager-xi2.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 1013fda2af..5c7a5a1614 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1122,8 +1122,11 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
GdkDeviceToolType tool_type;
tool_type = device_get_tool_type (device);
- tool = gdk_device_tool_new (serial_id, tool_id, tool_type, 0);
- gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
+ if (tool_type != GDK_DEVICE_TOOL_TYPE_UNKNOWN)
+ {
+ tool = gdk_device_tool_new (serial_id, tool_id, tool_type, 0);
+ gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]