From 307be1e4952bd5762e96219345e11448d8b0762e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 6 Jun 2020 12:46:47 +0200 Subject: [PATCH] clutter: Drop clutter_input_device_set_coords() Input devices aren't "updated" anymore, but their state queried to the seat. This goes nowhere. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403 --- .../clutter/clutter-input-device-private.h | 7 ---- clutter/clutter/clutter-input-device.c | 38 +------------------ clutter/clutter/clutter-stage.c | 18 --------- 3 files changed, 2 insertions(+), 61 deletions(-) diff --git a/clutter/clutter/clutter-input-device-private.h b/clutter/clutter/clutter-input-device-private.h index 93dc4ab3d..b3ba3bfff 100644 --- a/clutter/clutter/clutter-input-device-private.h +++ b/clutter/clutter/clutter-input-device-private.h @@ -121,8 +121,6 @@ struct _ClutterInputDevice int click_count; /* the current state */ - float current_x; - float current_y; int current_button_number; ClutterModifierType current_state; @@ -173,11 +171,6 @@ CLUTTER_EXPORT void clutter_input_device_update_from_tool (ClutterInputDevice *device, ClutterInputDeviceTool *tool); CLUTTER_EXPORT -void _clutter_input_device_set_coords (ClutterInputDevice *device, - ClutterEventSequence *sequence, - gfloat x, - gfloat y); -CLUTTER_EXPORT ClutterActor * clutter_input_device_update (ClutterInputDevice *device, ClutterEventSequence *sequence, ClutterStage *stage, diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c index 281dbdbfd..14133e987 100644 --- a/clutter/clutter/clutter-input-device.c +++ b/clutter/clutter/clutter-input-device.c @@ -512,8 +512,8 @@ clutter_input_device_init (ClutterInputDevice *self) self->click_count = 0; self->previous_time = CLUTTER_CURRENT_TIME; - self->current_x = self->previous_x = -1; - self->current_y = self->previous_y = -1; + self->previous_x = -1; + self->previous_y = -1; self->current_button_number = self->previous_button_number = -1; self->touch_sequences_info = @@ -540,40 +540,6 @@ _clutter_input_device_ensure_touch_info (ClutterInputDevice *device, return info; } -/*< private > - * clutter_input_device_set_coords: - * @device: a #ClutterInputDevice - * @sequence: a #ClutterEventSequence or NULL - * @x: X coordinate of the device - * @y: Y coordinate of the device - * - * Stores the last known coordinates of the device - */ -void -_clutter_input_device_set_coords (ClutterInputDevice *device, - ClutterEventSequence *sequence, - gfloat x, - gfloat y) -{ - g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device)); - - if (sequence == NULL) - { - if (device->current_x != x) - device->current_x = x; - - if (device->current_y != y) - device->current_y = y; - } - else - { - ClutterTouchInfo *info; - info = _clutter_input_device_ensure_touch_info (device, sequence); - info->current_x = x; - info->current_y = y; - } -} - /** * clutter_input_device_get_modifier_state: * @device: a #ClutterInputDevice diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index d99d366d2..e8509ad55 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -1013,7 +1013,6 @@ _clutter_stage_queue_event (ClutterStage *stage, { ClutterStagePrivate *priv; gboolean first_event; - ClutterInputDevice *device; g_return_if_fail (CLUTTER_IS_STAGE (stage)); @@ -1024,23 +1023,6 @@ _clutter_stage_queue_event (ClutterStage *stage, if (copy_event) event = clutter_event_copy (event); - /* if needed, update the state of the input device of the event. - * we do it here to avoid calling the same code from every backend - * event processing function - */ - device = clutter_event_get_device (event); - if (device != NULL && - event->type != CLUTTER_PROXIMITY_IN && - event->type != CLUTTER_PROXIMITY_OUT) - { - ClutterEventSequence *sequence = clutter_event_get_event_sequence (event); - gfloat event_x, event_y; - - clutter_event_get_coords (event, &event_x, &event_y); - - _clutter_input_device_set_coords (device, sequence, event_x, event_y, stage); - } - if (first_event) { gboolean compressible = event->type == CLUTTER_MOTION ||