mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
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.
This commit is contained in:
parent
7004818508
commit
eafa04230b
@ -145,6 +145,8 @@ struct _ClutterInputDeviceClass
|
|||||||
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
||||||
guint hardware_keycode,
|
guint hardware_keycode,
|
||||||
guint *evdev_keycode);
|
guint *evdev_keycode);
|
||||||
|
void (* update_from_tool) (ClutterInputDevice *device,
|
||||||
|
ClutterInputDeviceTool *tool);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Platform-dependent interface */
|
/* Platform-dependent interface */
|
||||||
@ -243,6 +245,9 @@ ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDev
|
|||||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||||
ClutterInputDeviceTool *tool);
|
ClutterInputDeviceTool *tool);
|
||||||
|
|
||||||
|
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||||
|
ClutterInputDeviceTool *tool);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
|
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
|
||||||
|
@ -2052,3 +2052,17 @@ clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||||
|
ClutterInputDeviceTool *tool)
|
||||||
|
{
|
||||||
|
ClutterInputDeviceClass *device_class;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||||
|
|
||||||
|
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
||||||
|
|
||||||
|
if (device_class->update_from_tool)
|
||||||
|
device_class->update_from_tool (device, tool);
|
||||||
|
}
|
||||||
|
@ -2489,6 +2489,9 @@ _clutter_process_event_details (ClutterActor *stage,
|
|||||||
|
|
||||||
case CLUTTER_PROXIMITY_IN:
|
case CLUTTER_PROXIMITY_IN:
|
||||||
case CLUTTER_PROXIMITY_OUT:
|
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))
|
if (_clutter_event_process_filters (event))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user