From 1e259a255a07cd16b31fc99e6bba3e9368fae6d9 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 9 Aug 2022 19:17:22 +0200 Subject: [PATCH] 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 --- protocol/wayland.xml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 17a17690..d95e5a2f 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. @@ -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. @@ -2468,6 +2473,14 @@ 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.