From 6a6894a3970f3916850bc563e138c4dc7a94c851 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 5 Jun 2020 15:33:25 +0200 Subject: [PATCH] clutter: Specify stage on clutter_input_device_update() function This is the function performing the picking, tell it explicitly the stage it should happen on. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486 --- clutter/clutter/clutter-input-device-private.h | 5 +++-- clutter/clutter/clutter-input-device.c | 11 +---------- clutter/clutter/clutter-main.c | 15 ++++++++++++--- clutter/clutter/clutter-stage.c | 2 +- src/wayland/meta-wayland-pointer.c | 5 ++++- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/clutter/clutter/clutter-input-device-private.h b/clutter/clutter/clutter-input-device-private.h index cad9b23a1..ed4c48073 100644 --- a/clutter/clutter/clutter-input-device-private.h +++ b/clutter/clutter/clutter-input-device-private.h @@ -200,8 +200,9 @@ void _clutter_input_device_set_actor (ClutterInputDevice *device, gboolean emit_crossing); CLUTTER_EXPORT ClutterActor * clutter_input_device_update (ClutterInputDevice *device, - ClutterEventSequence *sequence, - gboolean emit_crossing); + ClutterEventSequence *sequence, + ClutterStage *stage, + gboolean emit_crossing); CLUTTER_EXPORT void _clutter_input_device_add_event_sequence (ClutterInputDevice *device, ClutterEvent *event); diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c index ae52292a0..5f6ad1188 100644 --- a/clutter/clutter/clutter-input-device.c +++ b/clutter/clutter/clutter-input-device.c @@ -1001,9 +1001,9 @@ clutter_input_device_get_coords (ClutterInputDevice *device, ClutterActor * clutter_input_device_update (ClutterInputDevice *device, ClutterEventSequence *sequence, + ClutterStage *stage, gboolean emit_crossing) { - ClutterStage *stage; ClutterActor *new_cursor_actor; ClutterActor *old_cursor_actor; graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f); @@ -1012,15 +1012,6 @@ clutter_input_device_update (ClutterInputDevice *device, g_assert (device_type != CLUTTER_KEYBOARD_DEVICE && device_type != CLUTTER_PAD_DEVICE); - stage = device->stage; - if (G_UNLIKELY (stage == NULL)) - { - CLUTTER_NOTE (EVENT, "No stage defined for device %d '%s'", - clutter_input_device_get_device_id (device), - clutter_input_device_get_device_name (device)); - return NULL; - } - clutter_input_device_get_coords (device, sequence, &point); old_cursor_actor = clutter_input_device_get_actor (device, sequence); diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 1dbca4782..2f6f4d146 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -1624,7 +1624,8 @@ _clutter_process_event_details (ClutterActor *stage, emit_crossing_event (event, device); - actor = clutter_input_device_update (device, NULL, FALSE); + actor = clutter_input_device_update (device, NULL, + CLUTTER_STAGE (stage), FALSE); if (actor != stage) { ClutterEvent *crossing; @@ -1778,7 +1779,11 @@ _clutter_process_event_details (ClutterActor *stage, * get the actor underneath */ if (device != NULL) - actor = clutter_input_device_update (device, NULL, TRUE); + { + actor = clutter_input_device_update (device, NULL, + CLUTTER_STAGE (stage), + TRUE); + } else { CLUTTER_NOTE (EVENT, "No device found: picking"); @@ -1896,7 +1901,11 @@ _clutter_process_event_details (ClutterActor *stage, } if (device != NULL) - actor = clutter_input_device_update (device, sequence, TRUE); + { + actor = clutter_input_device_update (device, sequence, + CLUTTER_STAGE (stage), + TRUE); + } else { CLUTTER_NOTE (EVENT, "No device found: picking"); diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index 70661ede0..dc7b3f609 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -1281,7 +1281,7 @@ clutter_stage_update_devices (ClutterStage *stage, for (l = devices; l; l = l->next) { ClutterInputDevice *device = l->data; - clutter_input_device_update (device, NULL, TRUE); + clutter_input_device_update (device, NULL, stage, TRUE); } } diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index ab2ae9315..198b23d19 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -1044,7 +1044,10 @@ meta_wayland_pointer_start_popup_grab (MetaWaylandPointer *pointer, void meta_wayland_pointer_repick (MetaWaylandPointer *pointer) { - clutter_input_device_update (pointer->device, NULL, FALSE); + MetaBackend *backend = meta_get_backend (); + ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); + + clutter_input_device_update (pointer->device, NULL, stage, FALSE); repick_for_event (pointer, NULL); }