Skip to content

Clutter grabs (Pt. 1)

Carlos Garnacho requested to merge wip/carlosg/grabs-pt1 into main

Introduce yet another grab mechanism (so far!), this small contender is meant to eventually take over other grab mechanisms we have around. This grab could be defined as a focus manager, where actors are notified whenever a change of focus (e.g. a grab) would happen. This change of focus is expressed via crossing events.

These grabs are stackable, when a new grab happens on top of another it becomes the active one and pointer/touch/keyboard foci are notified of their new state. Overridden grabs become dormant in their place of the stack, and are able to either regain their position as the active grab, or give themselves up early on.

Unlike ClutterInputDevice grabs (which are more of a focus lock), these grabs affect the topmost actor that is eligible to receive events "as normal" (and play along with regular event propagation), while events that happen outside this subtree of the actor hierarchy are reported to this "root" (i.e. the actor holding the grab). The absence of grabs could be seen then as equivalent to a grab on the stage actor.

This grab mechanism also integrates with the backend, so the X11 backend can issue its own windowing grabs whenever there is one of these grabs.

This is the first MR in a probably long series. Depends on (and currently includes) !2024 (merged)

Edited by Carlos Garnacho

Merge request reports