-
-
Notifications
You must be signed in to change notification settings - Fork 28
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 keyboard mode flag to support both: "on-demand" & "exclusive" GTK layer-shell modes #95
Conversation
… not have keyboard input at all
If the exclusive mode is default, wouldn't it be enough to add a boolean argument for the on demand mode? |
Yes, now that I think about it again this makes more sense. The reason I went down the path of using a string flag was to support all the After testing this out, I realized that Now it can be represented by a simple binary on/off for |
Sorry for delay. I was busy at other projects. After some deliberation: I think we should just use |
On sway 1.8.1 setting keyboard mode |
I'd caution against making it the default unless also the app will grab focus on opening. In my testing, I could trigger I've tested on the following versions of
|
This was my experience too during testing. It's because the only mode supported for that version was
Sounds like it supports the
If you'd like to test... I built pre-release Arch packages from the |
Alright then. I'll merge it after #96. Sorry for prioritizing my own PR, which is younger, but your PR introduces less changes (in case of conflicts). |
No problem, you can prioritize however makes sense... it's your project after all 😉 FYI: I just uploaded both of the pre-release versions that I was testing to the Releases page @ gitlab.archlinux.org/trinitronx/nwg-drawer-git. I think the one for The other updated dependencies for sway |
This update is simple enough to need no special testing, for which I have too little time by the way. I'm sure you tested it well enough. I'm a bit in hurry to finish what I'm working on before my holiday starts. 🎉 As a hobbyist programmer, I have up to 4 hours a day (night!) for coding. |
Change
-k
flag to set the GTK layer shell keyboard focus modeexclusive
/e
(Default)on-demand
/o
none
mode does not seem to make sense for this app, because it disables keyboard input completely.Rationale / Background:
gtk-layer-shell
, and Wayland now supports an "On Demand" mode viazwlr_layer_surface_v1::keyboard_interactivity v4
for keyboard focus. The demo app also supports this mode and works well to demonstrate the newzwlr_layer_surface_v1::keyboard_interactivity v4
wayland protocol for the on-demand keyboard focus mode.Note that for this to behave differently, it requires a newer version of
sway
than is currently released on most Linux distros, but it will not break anything given the backwards-compatible behavior beingexclusive
by default. (e.g. without this change: swaywm/sway@913a7679 / swaywm/sway#7587 ... and withon-demand
mode set, it still behaves as ifexclusive
mode was set)The following PRs have made it into
wl-protocols
,wlroots
, >k-layer-shell
:Note: there is also one for wayfire: WayfireWM/wayfire#962
Testing the
gtk-layer-shell
demo program on Sway1.8.1
behaves the same. For example: 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". While not ideal from a UI/UX perspective, nor from an app developer perspective, it doesn't hurt to have this option in client programs to enable the feature when
sway
or other window managers adopt thezwlr_layer_surface_v1::keyboard_interactivity
v4
protocol.More information can be found in: swaywm/sway#7499.