[clutter/wip/evdev-tablet-support: 41/42] main: Allow updating device axes from the current tool
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/evdev-tablet-support: 41/42] main: Allow updating device axes from the current tool
- Date: Wed, 27 May 2015 14:56:49 +0000 (UTC)
commit 06ae792e93f96776778687b923d74b1b946102d4
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Feb 4 17:17:23 2015 +0100
main: Allow updating device axes from the current tool
This way devices are ensured the proper axis status at the time
of processing the events.
clutter/clutter-device-manager-private.h | 5 +++++
clutter/clutter-input-device.c | 14 ++++++++++++++
clutter/clutter-main.c | 3 +++
3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-device-manager-private.h b/clutter/clutter-device-manager-private.h
index 18c185c..7e4f160 100644
--- a/clutter/clutter-device-manager-private.h
+++ b/clutter/clutter-device-manager-private.h
@@ -153,6 +153,8 @@ struct _ClutterInputDeviceClass
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
guint hardware_keycode,
guint *evdev_keycode);
+ void (* update_from_tool) (ClutterInputDevice *device,
+ ClutterInputDeviceTool *tool);
};
/* device manager */
@@ -233,6 +235,9 @@ ClutterInputDeviceTool * _clutter_input_device_lookup_tool (ClutterInputDev
void _clutter_input_device_add_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool);
+void clutter_input_device_update_from_tool (ClutterInputDevice *device,
+ ClutterInputDeviceTool *tool);
+
G_END_DECLS
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index 18d8378..bd70543 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -2130,3 +2130,17 @@ clutter_input_device_tool_get_tool_type (ClutterInputDeviceTool *tool)
return tool->type;
}
+
+void
+clutter_input_device_update_from_tool (ClutterInputDevice *device,
+ ClutterInputDeviceTool *tool)
+{
+ ClutterInputDeviceClass *device_class;
+
+ g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
+
+ device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
+
+ if (device_class->update_from_tool)
+ device_class->update_from_tool (device, tool);
+}
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index 6c31eb2..f89cecc 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -2493,6 +2493,9 @@ _clutter_process_event_details (ClutterActor *stage,
case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT:
+ clutter_input_device_update_from_tool (clutter_event_get_source_device (event),
+ clutter_event_get_device_tool (event));
+
if (_clutter_event_process_filters (event))
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]