summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXaver Hugl <xaver.hugl@gmail.com>2022-08-09 19:17:22 +0200
committerSimon Ser <contact@emersion.fr>2023-04-12 13:37:51 +0000
commit1e259a255a07cd16b31fc99e6bba3e9368fae6d9 (patch)
tree79fe2070852905e8bd269b02ed0b98820130d215
parent307b23626d9fccc4ab9f72b23940f26c54505b0e (diff)
downloadwayland-1e259a255a07cd16b31fc99e6bba3e9368fae6d9.tar.gz
protocol: improve wl_keyboard focus documentation
The compositor must not send any key events while a surface is not focused, but in order to allow for common actions like ctrl+scroll for zooming to work with unfocused surfaces it may do so with modifiers. Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
-rw-r--r--protocol/wayland.xml17
1 files changed, 15 insertions, 2 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 17a1769..d95e5a2 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -2431,8 +2431,10 @@
The leave notification is sent before the enter notification
for the new focus.
- After this event client must assume that all keys, including modifiers,
- are lifted and also it must stop key repeating if there's some going on.
+ After this event client must assume that no keys are pressed,
+ it must stop key repeating if there's some going on and until
+ it receives the next wl_keyboard.modifiers event, the client
+ must also assume no modifiers are active.
</description>
<arg name="serial" type="uint" summary="serial number of the leave event"/>
<arg name="surface" type="object" interface="wl_surface" summary="surface that lost keyboard focus"/>
@@ -2457,6 +2459,9 @@
If this event produces a change in modifiers, then the resulting
wl_keyboard.modifiers event must be sent after this event.
+
+ The compositor must not send this event without a surface of the client
+ having keyboard focus.
</description>
<arg name="serial" type="uint" summary="serial number of the key event"/>
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
@@ -2468,6 +2473,14 @@
<description summary="modifier and group state">
Notifies clients that the modifier and/or group state has
changed, and it should update its local state.
+
+ The compositor may send this event without a surface of the client
+ having keyboard focus, for example to tie modifier information to
+ pointer focus instead. If a modifier event with pressed modifiers is sent
+ without a prior enter event, the client can assume the modifier state is
+ valid until it receives the next wl_keyboard.modifiers event. In order to
+ reset the modifier state again, the compositor can send a
+ wl_keyboard.modifiers event with no pressed modifiers.
</description>
<arg name="serial" type="uint" summary="serial number of the modifiers event"/>
<arg name="mods_depressed" type="uint" summary="depressed modifiers"/>