diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-12-22 17:25:48 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2020-12-22 18:27:37 +0100 |
commit | 794962327e5863f082c8c64fa82ec2ae7e2c5b75 (patch) | |
tree | 5963ad4bb1a45006579e0e13c59a948800bcdd95 | |
parent | 3d82da23ec8359dd29d64d1e92c67ed6eb32b413 (diff) | |
download | mutter-794962327e5863f082c8c64fa82ec2ae7e2c5b75.tar.gz |
clutter/main: Change picked actor before emitting crossing events
Updating the state before emitting the CLUTTER_LEAVE event allows its
handlers to query the pointer actor, and avoid getting the same actor
again. Conceptually, this makes picking more "atomic", and the events a
notification of the change.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1654>
-rw-r--r-- | clutter/clutter/clutter-main.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 2b57079cc..1ce532012 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -1608,6 +1608,11 @@ clutter_stage_update_device (ClutterStage *stage, old_actor = clutter_stage_get_device_actor (stage, device, sequence); device_actor_changed = new_actor != old_actor; + clutter_stage_update_device_entry (stage, + device, sequence, + point, + new_actor); + if (device_actor_changed) { CLUTTER_NOTE (EVENT, @@ -1625,15 +1630,7 @@ clutter_stage_update_device (ClutterStage *stage, old_actor, new_actor, point, time); } - } - clutter_stage_update_device_entry (stage, - device, sequence, - point, - new_actor); - - if (device_actor_changed) - { if (new_actor && emit_crossing) { create_crossing_event (stage, |