[mutter/wip/carlosg/repick-on-reactive: 2/2] clutter/actor: Handle repicks when actors become reactive
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/repick-on-reactive: 2/2] clutter/actor: Handle repicks when actors become reactive
- Date: Tue, 26 Jul 2022 12:06:32 +0000 (UTC)
commit 8dd51decc172f57d83b8b371ed952e16b1064f62
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 26 13:54:22 2022 +0200
clutter/actor: Handle repicks when actors become reactive
The notification list in the GNOME Shell calendar popup triggers some
interesting interactions when closing a notification:
- Close button is clicked
- The notification animates to be hidden
- The next notification ends up hovered as a result of the animation
- The notification being hovered sets its close button as non-transparent
and reactive
- The pointer is now again over a close button
At this point the reactiveness change should trigger a repick, so that
the new notification's close button is picked, and future button presses
are directed to it, but we do not handle this situation.
To fix this, handle actors becoming reactive so that if the closest
reactive parent has a pointer, it will be repicked again just in case
the pointer is over the newly reactive actor.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2364
clutter/clutter/clutter-actor.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 067666cc6c..a844326ab6 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -12494,6 +12494,30 @@ clutter_actor_set_reactive (ClutterActor *actor,
clutter_stage_invalidate_focus (CLUTTER_STAGE (stage), actor);
}
+ else if (CLUTTER_ACTOR_IS_REACTIVE (actor))
+ {
+ ClutterActor *parent;
+
+ /* Check whether the closest parent has pointer focus,
+ * and whether it should move to this actor.
+ */
+ parent = priv->parent;
+
+ while (parent)
+ {
+ if (clutter_actor_get_reactive (parent))
+ break;
+
+ parent = clutter_actor_get_parent (parent);
+ }
+
+ if (parent && clutter_actor_has_pointer (parent))
+ {
+ ClutterActor *stage = _clutter_actor_get_stage_internal (actor);
+
+ clutter_stage_invalidate_focus (CLUTTER_STAGE (stage), parent);
+ }
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]