mirror of
https://github.com/brl/mutter.git
synced 2025-01-27 03:49:03 +00:00
clutter/stage: Update stored pointer coordinates in fast paths
If we are still under the "clear area" of the pick actor, we forget to update the coordinates. This is usually not needed, unless we need to repick again for non-event circumstances (e.g. pick actor is destroyed). This will ensure the right pointer coordinates are used afterwards in those situations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1915>
This commit is contained in:
parent
9475b872c0
commit
757d595fa3
@ -3440,6 +3440,24 @@ clutter_stage_get_device_coords (ClutterStage *stage,
|
||||
*coords = entry->coords;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_set_device_coords (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t coords)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
PointerDeviceEntry *entry = NULL;
|
||||
|
||||
if (sequence != NULL)
|
||||
entry = g_hash_table_lookup (priv->touch_sequences, sequence);
|
||||
else
|
||||
entry = g_hash_table_lookup (priv->pointer_devices, device);
|
||||
|
||||
if (entry)
|
||||
entry->coords = coords;
|
||||
}
|
||||
|
||||
static void
|
||||
create_crossing_event (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
@ -3587,7 +3605,11 @@ clutter_stage_pick_and_update_device (ClutterStage *stage,
|
||||
{
|
||||
if (clutter_stage_check_in_clear_area (stage, device,
|
||||
sequence, point))
|
||||
return clutter_stage_get_device_actor (stage, device, sequence);
|
||||
{
|
||||
clutter_stage_set_device_coords (stage, device,
|
||||
sequence, point);
|
||||
return clutter_stage_get_device_actor (stage, device, sequence);
|
||||
}
|
||||
}
|
||||
|
||||
new_actor = _clutter_stage_do_pick (stage,
|
||||
|
Loading…
x
Reference in New Issue
Block a user