Skip to content
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

Add XkbContext::update_mask and XkbContext::set_update_key #1597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Nov 23, 2024

For a nested compositor, it's useful to be able to pass through the modifiers state from the parent compositor unchanged. set_mask provides a way to do that. Meanwhile set_update_key() provides a way to disable the current calls to xkb_context_updatE_key.

Alternately to set_update_key(), a boolean argument could be added to both input() and input_intercept(). Not sure which is better. Either is a bit ugly.

update_mask uses seperate arguments for depressed/latched/locked instead of SerializedMods, since effective isn't applicable here. It uses u32 for those, like SerializedMods, but Layout for the layout since it exists. Xkbcommon has a separate depressed/latched/locked layout, but we only use one since that's what the set_layout function and wl_keyboard::modifiers already assumes. (I guess X11 differentiated these, but depressed/latched didn't end up being used in practice?)

This could also be used on the X11 backend. I'm not sure if winit exposes the necessary information to call set_mask.

For a nested compositor, it's useful to be able to pass through the
modifiers state from the parent compositor unchanged. `set_mask`
provides a way to do that. Meanwhile `set_update_key()` provides a way
to disable the current calls to `xkb_context_updatE_key`.

Alternately to `set_update_key()`, a boolean argument could be added to
both `input()` and `input_intercept()`. Not sure which is better. Either
is a bit ugly.

`update_mask` uses seperate arguments for depressed/latched/locked
instead of `SerializedMods`, since `effective` isn't applicable here. It
uses `u32` for those, like `SerializedMods`, but `Layout` for the layout
since it exists. Xkbcommon has a separate depressed/latched/locked
layout, but we only use one since that's what the `set_layout` function
and `wl_keyboard::modifiers` already assumes. (I guess X11 differentiated
these, but depressed/latched didn't end up being used in practice?)

This could also be used on the X11 backend. I'm not sure if winit
exposes the necessary information to call `set_mask`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant