[gtk+/wip/wayland-tablet-v2: 23/41] gdk: Pass hardware ID on gdk_device_tool_new()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/wayland-tablet-v2: 23/41] gdk: Pass hardware ID on gdk_device_tool_new()
- Date: Tue, 23 Aug 2016 18:33:13 +0000 (UTC)
commit 2ce5df5e12d98833b079738117b2cd148cc89ed0
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Aug 4 18:52:51 2016 +0200
gdk: Pass hardware ID on gdk_device_tool_new()
And implement this on wayland, where this information is already obtained.
gdk/gdkdevicetool.c | 2 ++
gdk/gdkdevicetoolprivate.h | 2 ++
gdk/wayland/gdkdevice-wayland.c | 4 +++-
gdk/x11/gdkdevicemanager-xi2.c | 2 +-
4 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkdevicetool.c b/gdk/gdkdevicetool.c
index d632504..1b1cd38 100644
--- a/gdk/gdkdevicetool.c
+++ b/gdk/gdkdevicetool.c
@@ -137,11 +137,13 @@ gdk_device_tool_init (GdkDeviceTool *tool)
GdkDeviceTool *
gdk_device_tool_new (guint64 serial,
+ guint64 hw_id,
GdkDeviceToolType type,
GdkAxisFlags tool_axes)
{
return g_object_new (GDK_TYPE_DEVICE_TOOL,
"serial", serial,
+ "hardware-id", hw_id,
"tool-type", type,
"axes", tool_axes,
NULL);
diff --git a/gdk/gdkdevicetoolprivate.h b/gdk/gdkdevicetoolprivate.h
index ff9a404..63d0636 100644
--- a/gdk/gdkdevicetoolprivate.h
+++ b/gdk/gdkdevicetoolprivate.h
@@ -28,6 +28,7 @@ struct _GdkDeviceTool
{
GObject parent_instance;
guint64 serial;
+ guint64 hw_id;
GdkDeviceToolType type;
GdkAxisFlags tool_axes;
};
@@ -38,6 +39,7 @@ struct _GdkDeviceToolClass
};
GdkDeviceTool *gdk_device_tool_new (guint64 serial,
+ guint64 hw_id,
GdkDeviceToolType type,
GdkAxisFlags tool_axes);
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index c13818e..315ebdc 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -3105,7 +3105,9 @@ tablet_tool_handle_done (void *data,
{
GdkWaylandTabletToolData *tool = data;
- tool->tool = gdk_device_tool_new (tool->hardware_serial, tool->type, tool->axes);
+ tool->tool = gdk_device_tool_new (tool->hardware_serial,
+ tool->hardware_id_wacom,
+ tool->type, tool->axes);
gdk_seat_tool_added (tool->seat, tool->tool);
}
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 6145877..2fd413c 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1030,7 +1030,7 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
if (!tool && serial_id > 0)
{
- tool = gdk_device_tool_new (serial_id,
+ tool = gdk_device_tool_new (serial_id, 0,
GDK_DEVICE_TOOL_TYPE_UNKNOWN, 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]