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
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2532>
This commit is contained in:
Carlos Garnacho 2022-07-26 13:54:22 +02:00 committed by Marge Bot
parent 6dabdec10e
commit 550b66d4e6

View File

@ -12494,6 +12494,30 @@ clutter_actor_set_reactive (ClutterActor *actor,
clutter_stage_invalidate_focus (CLUTTER_STAGE (stage), 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_IS_REACTIVE (parent))
break;
parent = parent->priv->parent;
}
if (parent && parent->priv->has_pointer)
{
ClutterActor *stage = _clutter_actor_get_stage_internal (actor);
clutter_stage_maybe_invalidate_focus (CLUTTER_STAGE (stage), parent);
}
}
} }
/** /**