grabHelper: Fix handling of events within the grabbed actor

Commit d92b71d2b2 went overeager in the removal of the additional
actors that were allowed to handle events (since the new grab
infrastructure makes them unable to see events in the first place),
and removed an early return in the captured event handler meant to
let events go through in those cases.

Since the grabbing actor was also part of this group, this was also
the code path where child actors of the grabbing actor could handle
events. Removing these made the captured event handler eat most
events meant for children. Add this check back, specifically for the
grabbing actor.

While at it, explicitly check (and propagate) crossing events,
since these are now enforced to be propagated (and warned about) in
Mutter.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4991
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>
This commit is contained in:
Carlos Garnacho 2022-01-31 12:16:47 +01:00 committed by Marge Bot
parent f6edfd503b
commit e374a4957f

View File

@ -261,6 +261,11 @@ var GrabHelper = class GrabHelper {
return Clutter.EVENT_PROPAGATE;
}
if (type === Clutter.EventType.ENTER ||
type === Clutter.EventType.LEAVE ||
this.currentGrab.actor.contains(event.get_source()))
return Clutter.EVENT_PROPAGATE;
if (Main.keyboard.shouldTakeEvent(event))
return Clutter.EVENT_PROPAGATE;