-
Notifications
You must be signed in to change notification settings - Fork 29
Proposal for more options regarding keyboard interactivity for layer-shell clients #100
Proposal for more options regarding keyboard interactivity for layer-shell clients #100
Conversation
wlroots branch for this (including updated layer-shell example): Wayfire branch: gtk-layer-shell branch (including updated demo): example: cairo-dock branch using this to allow shift + click to start a new instance of a running program: |
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.
A few small nitpicks. Aside from that, LGTM, and I think this is a necessary addition if we want to grow layer-shell into the equivalent of _NET_WM_STATE_ABOVE
and similar.
Hi, |
@dkondor You should open PRs at least in wlroots, so that the implementation can be reviewed (this is the usual procedure for protocols, protocol is drafted, then implementation, and then both are reviewed at the same time to ensure theory matches practice) |
Ok, sure :) |
<description summary="request exclusive keyboard focus"> | ||
Request exclusive keyboard focus if this surface is above the shell surface layer. | ||
|
||
For layers above the shell surface layers, the seat will always give |
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.
This sounds a little bit like this is writing down compositor policy. I'd like to make it clear that compositors can decide to implement a different policy, e.g. don't give focus to any keyboard-interactive layer surface when a lockscreen is active.
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.
Ah, it seems like the wording comes from the original description for set_keyboard_interactivity
.
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.
Yes, for this option, I took the current wording :)
I agree there is no guarantee to e.g. prevent stealing the focus from a lock screen either in the current protocol or this PR. I feel this could be a separate issue though.
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.
Yes, you're right. We can fix it separately.
will receive keyboard focus (if ever). | ||
|
||
For layers below the shell surface layer, the seat will use | ||
normal focus semantics. |
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.
It doesn't seem like this is backwards-compatible. I think e.g. Sway never gives focus in this case.
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.
Then sway isn't compliant with the current version of the protocol ;)
https://github.com/swaywm/wlr-protocols/blob/master/unstable/wlr-layer-shell-unstable-v1.xml#L209
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.
Indeed, you're correct. This makes the change in this PR look less scary, because it just allows top/overlay layers to get the same behaviour as bottom/background layers which have keyboard interactivity set to 1.
I'd still prefer to allow compositors to not give focus if they don't want to, though.
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.
I'm changing this to optional. With this change, clients that want normal focus can just use the next option.
<description summary="request exclusive keyboard focus"> | ||
Request exclusive keyboard focus if this surface is above the shell surface layer. | ||
|
||
For layers above the shell surface layers, the seat will always give |
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.
This is the first time this protocol refers to a concept of "shell surface layer", I think? I wouldn't want to force compositors to have a single "shell surface layer" (which contains the regular toplevel surfaces if I understand your intention?).
The existing paragraph about the layer
enum just describes what a compositor typically does. Maybe a compositor has an always-on-top setting for a toplevel and will put the toplevel between the top and the overlay layer?
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.
Maybe instead of "shell surface layer", it could say explicitly that this refers to the top and overlay layers?
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.
This sounds good to me.
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.
I wonder if there could be more explicit wording (1) specifying whether the compositor is allowed to put non-layer-shell surfaces in any of the layers in the "layer" enum; and (2) noting that compositors will have additional "layers" beside the ones listed in the layer enum, that have a well-defined z-order relative to them (so e.g. if a fullscreen toplevel is above the "top" layer, a layer shell surface in the top layer will not receive exclusive keyboard focus).
prompt. | ||
</description> | ||
</entry> | ||
<entry name="user" value="2"> |
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.
Bikeshedding time: maybe we can come up with a better name?
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.
I agree, but so far I couldn't think of anything better :)
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.
regular
? on_demand
? (just ideas)
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.
I like on_demand
b6e4bb1
to
5630799
Compare
I've taken the liberty to split your changes into 4 logical commits, to avoid having a single mega-commit that does many different things at once. I've also changed these things:
Are you okay with these changes? |
Sure, it all seems good. Thanks! |
Currently only background and bottom layers can have surfaces with normal focus semantics. Allow top and overlay layers to have these semantics too (instead of exclusive). Closes: swaywm#32
5630799
to
f12bdac
Compare
OK, I've pushed the clarifications and minor improvements to master so that this PR only contains the new This PR LGTM, I'll have a look at the compositor and client implementations linked in #100 (comment). |
Can you open pull requests for these various branches? Would make it easier to add comments. |
wlroots PR: swaywm/wlroots#2555 I've just opened a PR for gtk-layer-shell: |
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
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.
Thanks!
I'm opening this as a concrete proposal for #32
I believe the current protocol makes it hard to have layer-shell surfaces in the top layer (e.g. panels and docks) that have keyboard interaction on their main surface and not in popups.
Let me know if I should provide more motivation or use cases.
My intention for this is to be backward-compatible with the current protocol (0/1 values for keyboard interactivity keep their meaning).