-
Notifications
You must be signed in to change notification settings - Fork 341
Keyboard interactivity options #2555
Keyboard interactivity options #2555
Conversation
Matching Wayfire PR: WayfireWM/wayfire#962 |
types/wlr_layer_shell_v1.c
Outdated
@@ -498,7 +509,7 @@ struct wlr_layer_shell_v1 *wlr_layer_shell_v1_create(struct wl_display *display) | |||
} | |||
|
|||
struct wl_global *global = wl_global_create(display, | |||
&zwlr_layer_shell_v1_interface, 2, layer_shell, layer_shell_bind); | |||
&zwlr_layer_shell_v1_interface, zwlr_layer_shell_v1_interface.version, layer_shell, layer_shell_bind); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't advertise zwlr_layer_shell_v1_interface.version
here, because re-compiling with an XML file that has v5 won't make the wlroots code handle v5 properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just rebased on master after #2608 -- I'm still wondering if it would make sense to allow a compositor to request a lower version than available in wlroots (so if it does not support the new version, only the lower version will be advertised to clients). It would still be a breaking change though since that would need to be an extra parameter for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our policy so far has been that compositors always need to support the version supported by wlroots.
In this particular case it's not a big deal because compositors are not required to focus layer surfaces.
Also need to update the protocol XML to the latest version. |
b4786c1
to
837574c
Compare
I've addressed the comments, aside from my question about letting the compositor set the version it wants to support; if you think it's worth it, I can try to add a separate interface for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can you squash everything into a single commit?
Value is now an enum with a new value ("on-demand") that compositors can use to allow "normal" keyboard focus semantics regardless of the layer the client surface is on. An error is sent for invalid keyboard interactivity values. The old behavior is retained for clients using the previous version of the protocol. Also adjusted the layer-shell example program to use the new keyboard interactivity options.
837574c
to
6498666
Compare
Great, I just squashed it, thanks! |
Thanks! |
Implementation for swaywm/wlr-protocols#100
The goal of this is to enable layer-shell clients to have "regular" keyboard focus semantics. This can make it easier to implement layer-shell clients (no need to adjust the keyboard-interactivity setting when needed); also, it allows better support for keyboard interaction on the main layer-shell surface, including being notified of keyboard notifiers along with mouse clicks.
For clients using the old version of the protocol, any value is still interpreted as requesting exclusive focus. For clients with using the new protocol version, the compositor can interpret the given value. according to its policies.
Question: should there be a way for compositors to specify which version to use in wlr_layer_shell_v1_create()?
Breaking change:
wlr_layer_surface_v1_state.keyboard_interactivity
has now the typeenum zwlr_layer_surface_v1_keyboard_interactivity
to reflect protocol changes.