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
This commit is contained in:
Carlos Garnacho 2020-06-05 15:33:25 +02:00 committed by Jonas Ådahl
parent 3c8376ad91
commit 6a6894a397
5 changed files with 21 additions and 17 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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");

View File

@ -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);
}
}

View File

@ -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);
}