-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestion: allow xkb_state_update_mask() to accept negative groups to unlock group wrapping functionality #310
Comments
I'm curious where negative values come from exactly? |
The calling code could pass just |
Right now, we have to do the wrapping ourselves here in KWin, which duplicates the code above: |
I see, thanks. As you can see from the
Like many things in XKB, I'm pretty sure this functionality is entirely unused, but it's supported by libxkbcommon and you can never know what configs people have. So question is, when switching to prev/next in KWin UI, do you want the "Out of range group action" to be consulted, or always wrap? |
Lines 690 to 694 in f60bdb1
I see right now it always wraps, which corresponds to our current behavior. If it ever change, I think we could iterate from that. |
Right, I was confusing the "global" active layout (which always wraps as we don't support the global "XKB Controls" like X11 does), and the per-key derived layout. So that's fine. The next problem is that
that is, it is only meant to be used as a counterpart to Of course, KWin is entirely justified in using it this way, as xkbcommon doesn't provide any other way for a UI toggle to switch the layout in the master state. From this lens, If we design such a function, would you be able to use it? |
Yes I think we could use it, just thought it maybe feasible to change the type for |
On a second thought, do we really need a new function here if the same can be achieved with the existing one? |
…server state Up to now, the "server state" xkb_state API only offered one entry point to update the server state - `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[0], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that's a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [0] https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: #310 Signed-off-by: Ran Benita <[email protected]>
I've created a proposal for a new function for doing this - #314. Not implemented yet, just the API, but let me know if you have any thoughts on it. |
…server state Up to now, the "server state" xkb_state API only offered one entry point to update the server state - `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[0], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that's a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [0] https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: #310 Signed-off-by: Ran Benita <[email protected]>
Related: #72 |
… server state Up to now, the “server state” `xkb_state`` API only offered one entry point to update the server state - `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[^1], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that’s a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [1]: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: xkbcommon#310 Signed-off-by: Ran Benita <[email protected]> Co-authored-by: Ran Benita <[email protected]> Co-authored-by: Pierre Le Marre <[email protected]>
… server state Up to now, the “server state” `xkb_state`` API only offered one entry point to update the server state - `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[^1], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that’s a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [1]: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: xkbcommon#310 Signed-off-by: Ran Benita <[email protected]> Co-authored-by: Ran Benita <[email protected]> Co-authored-by: Pierre Le Marre <[email protected]>
Up to now, the “server state” `xkb_state` API only offered one entry point to update the server state – `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[^1], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that’s a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [^1]: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: xkbcommon#310 Signed-off-by: Ran Benita <[email protected]> Co-authored-by: Ran Benita <[email protected]> Co-authored-by: Pierre Le Marre <[email protected]>
libxkbcommon/src/state.c
Lines 792 to 798 in f60bdb1
xkb_layout_index_t
is unsigned int which prevents us from passing a negative group to utilize internal group wrapping:libxkbcommon/src/state.c
Lines 192 to 195 in f60bdb1
This forces the client to re-implement that wrapping on it's side, which is unnecessary.
Could we just declare the
*_group
arguments asint32_t
?The text was updated successfully, but these errors were encountered: