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 view steals the focus from scale plugin #2422

Closed
dkondor opened this issue Aug 4, 2024 · 3 comments
Closed

layer-shell view steals the focus from scale plugin #2422

dkondor opened this issue Aug 4, 2024 · 3 comments
Labels

Comments

@dkondor
Copy link
Contributor

dkondor commented Aug 4, 2024

Describe the bug
If scale is started when a layer-shell surface has the keyboard focus, it cannot grab the focus for itself.

To Reproduce
Steps to reproduce the behavior:

  1. Enable the scale plugin
  2. Ensure that a layer-shell surface has the keyboard focus
  3. Start the scale plugin (keybinding or IPC works)

Expected behavior
Scale has keyboard interaction (e.g. arrows, ESC).

Actual behavior
Scale starts, but the layer-shell surface continues to have the keyboard focus. Using the mouse to interact with scale does work. Interestingly, the scale-title-filter plugin also works.

Wayfire version
git, 44e1fa9

This can be easily reproduced using the gtk-layer-demo program (setting keyboard interactivity to "On demand"). I'm also attaching a simple test case (in Python, but Github does not allow .py) that calls scale via IPC when a button is clicked.

Real-world case: Cairo-Dock with this plugin

ipc_window.txt

@dkondor dkondor added the bug label Aug 4, 2024
@ammen99
Copy link
Member

ammen99 commented Aug 23, 2024

Believe it or not, this is intentional. Scale's input grab is below the layer where panels and docks usually are. This is done so that you can indeed interact with wf-panel and other panels while in scale, someone requested this feature awhile ago. The solution/expectation is to have your dock not be keyboard interactive unless it really needs to interact with the keyboard.

@dkondor
Copy link
Contributor Author

dkondor commented Aug 24, 2024

Thanks for the explanation! BTW is there a recommended way for "losing" the keyboard focus from a layer-shell view while keeping the availability to be focused later? Switching keyboard-interactivity to NONE and back to ON_DEMAND grabs again the keyboard focus.

@ammen99
Copy link
Member

ammen99 commented Aug 25, 2024

It shouldn't grab on the switch back to on-demand, this is probably a bug. On-demand should be auto-focused only on map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants