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

layer-shell: do not grab focus if keyboard interactivity is set to ON_DEMAND #2530

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

Conversation

dkondor
Copy link
Contributor

@dkondor dkondor commented Dec 6, 2024

Fixes #2450

This change avoids automatically focusing layer-shell surfaces when their keyboard interactivity is changed to ON_DEMAND. As discussed in #2422 (comment), this is not intended. However, this change can lead to unexpected changes if an app expects that this will grab focus. So it might not be the best solution after all.

Main change: Layer-shell views can now intentionally lose focus by setting keyboard interactivity to NONE and then back to ON_DEMAND (thus allowing them to be later refocused by normal user interactions; this was not possible before).

Possible drawback: if an app sets keyboard interactivity to ON_DEMAND as a response to user action (e.g. mouse click), it will not get keyboard focus until further user action. This is demonstrated e.g. by the test code in issue #2450 where after applying this patch, clicking on the "On demand" button will not grab focus. However, grabbing focus is still possible by first setting it to EXCLUSIVE and then back to ON_DEMAND (this is e.g. used by wf-shell which continues to work fine with this patch applied).

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.

layer-shell: setting keyboard-interactivity to ON_DEMAND always grabs the focus
1 participant