protocol: define implicit pointer grab

It was mentioned in a lot of places, but never defined, which has caused some
divergent implementations over time. While an implicit pointer grab is active,
some compositors don't allow pointer focus to switch between toplevel and
popups, and some applications assume the grab also works on a subsurface level.

This commit defines implicit pointer grabs to only lock pointer focus to the
current surface tree, but not to any specific (sub)surface or popup.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
This commit is contained in:
Xaver Hugl 2026-02-17 17:10:21 +01:00
parent 5231c0ee20
commit 23445b5246

View file

@ -2189,6 +2189,13 @@
kernel's event code list. All other button codes above 0xFFFF are
currently undefined but may be used in future versions of this
protocol.
When a button is pressed, an implicit pointer grab is started.
While the implicit grab is active, the compositor should keep pointer
focus on surfaces of the same surface tree, which consists of
subsurfaces and popups on the same root surface.
The implicit grab stops being active if either all buttons are released,
or some compositor-specific situations occurs (like screen locking).
</description>
<arg name="serial" type="uint" summary="serial number of the button event"/>
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>