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

zwlr_layer_surface_v1::keyboard_interactivity v4 #7499

Open
WhyNotHugo opened this issue Mar 9, 2023 · 4 comments
Open

zwlr_layer_surface_v1::keyboard_interactivity v4 #7499

WhyNotHugo opened this issue Mar 9, 2023 · 4 comments
Labels
enhancement New feature or incremental improvement

Comments

@WhyNotHugo
Copy link
Contributor

This is a feature request for zwlr_layer_surface_v1::keyboard_interactivity v4::on_demand:

This requests the compositor to allow this surface to be focused and unfocused by the user in an implementation-defined manner. The user should be able to unfocus this surface even regardless of the layer it is on.

Typically, the compositor will want to use its normal mechanism to manage keyboard focus between layer shell surfaces with this setting and regular toplevels on the desktop layer (e.g. click to focus). Nevertheless, it is possible for a compositor to require a special interaction to focus or unfocus layer shell surfaces (e.g. requiring a click even if focus follows the mouse normally, or providing a keybinding to switch focus between layers).

This setting is mainly intended for desktop shell components (e.g. panels) that allow keyboard interaction. Using this option can allow implementing a desktop shell that can be fully usable without the mouse.

I think a suitable implementation for sway is to handle focus like a a floating window (e.g.: same mouse rules and same mapping to toggle focus).

If the previous state was exclusive, it initially has focus, if its previous state was none, it does not.

@WhyNotHugo WhyNotHugo added the enhancement New feature or incremental improvement label Mar 9, 2023
@WhyNotHugo
Copy link
Contributor Author

In particular, I want to use this for shotman, which uses this protocol.

@WhyNotHugo
Copy link
Contributor Author

@trinitronx
Copy link

trinitronx commented Jul 23, 2023

Adding a +1 to this, given that the following PRs have made it into wl-protocols, wlroots, & gtk-layer-shell:

Note: FWIW, there is also one for wayfire: WayfireWM/wayfire#962

Testing the quick gtk-layer-shell demo program (examples/gtk-layer-demo) on Sway 1.8.1 seems to still have non-ideal behavior when setting the "On Demand" keyboard mode (--keyboard o) and either "Top" or "Overlay" layers (--layer t or --layer o).

When on these layers, it's impossible to get keyboard focus off of the demo program window without first setting keyboard setting back to "None". Not ideal from a UI/UX perspective, nor from an app developer perspective given the protocol's promise of an "On Demand" keyboard mode versus "Exclusive".

@trinitronx
Copy link

trinitronx commented Jul 23, 2023

Notes:

EDIT: I just tested building from source each package. I can confirm that the gtk-layer-shell demo behaves properly on latest sway + wlroots git branches:

00:00:00.000 [INFO] [sway/main.c:338] Sway version 1.9-dev-dc634c4a (Jul 23 2023, branch 'master')
00:00:00.000 [INFO] [sway/main.c:339] wlroots version 0.17.0-dev

Unless this gets backported to the 1.8 branch, users expecting the "On Demand" keyboard focus behavior will have to wait until newer packages of sway are released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

No branches or pull requests

2 participants