[mutter/wip/carlosg/input-thread: 6/86] clutter: Use ClutterSeat underneath coords/modifiers input device getters
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 6/86] clutter: Use ClutterSeat underneath coords/modifiers input device getters
- Date: Sun, 22 Nov 2020 17:34:01 +0000 (UTC)
commit c7491f24652499c29451b9136bb9b28001365425
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jun 5 23:11:56 2020 +0200
clutter: Use ClutterSeat underneath coords/modifiers input device getters
This is not device state, but belonging to seat guts.
clutter/clutter/clutter-input-device.c | 31 +++++++++++++------------------
1 file changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index 52613317fe..7a17f227e0 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -579,9 +579,17 @@ _clutter_input_device_set_state (ClutterInputDevice *device,
ClutterModifierType
clutter_input_device_get_modifier_state (ClutterInputDevice *device)
{
+ uint32_t modifiers;
+ ClutterSeat *seat;
+
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
- return device->current_state;
+ seat = clutter_input_device_get_seat (device);
+
+ if (!clutter_seat_query_state (seat, device, NULL, NULL, &modifiers))
+ return 0;
+
+ return modifiers;
}
static void
@@ -859,27 +867,14 @@ clutter_input_device_get_coords (ClutterInputDevice *device,
ClutterEventSequence *sequence,
graphene_point_t *point)
{
+ ClutterSeat *seat;
+
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
g_return_val_if_fail (point != NULL, FALSE);
- if (sequence == NULL)
- {
- point->x = device->current_x;
- point->y = device->current_y;
- }
- else
- {
- ClutterTouchInfo *info =
- g_hash_table_lookup (device->touch_sequences_info, sequence);
-
- if (info == NULL)
- return FALSE;
+ seat = clutter_input_device_get_seat (device);
- point->x = info->current_x;
- point->y = info->current_y;
- }
-
- return TRUE;
+ return clutter_seat_query_state (seat, device, sequence, point, NULL);
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]