Skip to content

clutter: Return input-only ClutterGrabs as an out parameter

As these are used by MetaWaylandInput, the creation of a grab will trigger a check on the current focus of various input devices, but at a time that the MetaWaylandInput still does not have yet its own ClutterGrab instance, this results in the focus surface maybe being off right at grab creation, fixed by later focus invalidations.

But this glitch is enough for GtkMenu in gtk to think in some situations that focus went away from its surface tree, and dismiss the just opened menu.

To fix this, make clutter_stage_grab_input_only() take an out parameter for the grab, so this is filled in sooner in the process, and the get_focus_surface() method in MetaWaylandEventInterface will correctly see that the just created grab is actually the MetaWaylandInput's own, avoiding the focus glitch.

Closes: #3463 (closed)

Merge request reports