clutter: Use ClutterSeat underneath coords/modifiers input device getters

This is not device state, but belonging to seat guts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho 2020-06-05 23:11:56 +02:00 committed by Marge Bot
parent 9d195b3fa4
commit cb7794c19c

View File

@ -579,9 +579,17 @@ _clutter_input_device_set_state (ClutterInputDevice *device,
ClutterModifierType ClutterModifierType
clutter_input_device_get_modifier_state (ClutterInputDevice *device) clutter_input_device_get_modifier_state (ClutterInputDevice *device)
{ {
uint32_t modifiers;
ClutterSeat *seat;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0); 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 static void
@ -859,27 +867,14 @@ clutter_input_device_get_coords (ClutterInputDevice *device,
ClutterEventSequence *sequence, ClutterEventSequence *sequence,
graphene_point_t *point) graphene_point_t *point)
{ {
ClutterSeat *seat;
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE); g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
g_return_val_if_fail (point != NULL, FALSE); g_return_val_if_fail (point != NULL, FALSE);
if (sequence == NULL) seat = clutter_input_device_get_seat (device);
{
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 clutter_seat_query_state (seat, device, sequence, point, NULL);
return FALSE;
point->x = info->current_x;
point->y = info->current_y;
}
return TRUE;
} }
/* /*