Ideas on adding wlr-layer-shell #55
Closed
ehopperdietzel
started this conversation in
Ideas
Replies: 2 comments 18 replies
-
The layer of wlr_layer_surface can be changed, a layerChanged() callback may be required? |
Beta Was this translation helpful? Give feedback.
10 replies
-
@Fox2Code wlr-layer-shell is now working! Here’s a demo: https://www.youtube.com/watch?v=lS9wvJtjbYw I won’t add more protocols for now. I'll focus on polishing the API, performing tests, and updating the tutorial and documentation. Once that’s done, v2.0.0 will be ready for release :D |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello @Paraworker and @Fox2Code, I'm implementing wlr-layer-shell and I would like to know your opinions before proceeding.
Currently, Louvre provides a list of surfaces (
LCompositor::surfaces()
) that respects the Z-order of surfaces according to their roles (from bottom to top) and offers the methodLSurface::raise()
to modify that order. However, if, for example, raise is called on a surface with the role of subsurface, its topmost parent and the entire subtree of surfaces are elevated, not just the subsurface. This is done to maintain the Z order of the protocol.Each surface also has
LSurface::prevSurface()
andLSurface::nextSurface()
to access neighboring surfaces in theLCompositor::surfaces()
list, and a virtual methodLSurface::orderChanged()
that is invoked whenever the surface's position in the list changes. This allows, for example, maintaining and updating the order in an external list such as when usingLScene
andLView
.However, wlr-layer-shell introduces the concept of layers, specifically:
The protocol mentions that generally surfaces with other roles should be placed between the bottom and top layers, and fullscreen surfaces should be in the top layer.
Therefore, what I'm planning is, in addition to having only the
LCompositor::surfaces()
list, to also add the following lists:If the user calls the raise method, the surface(s) would be raised within their current layer. I don't want to add an API to reassign a surface's layer, that would allow the user to break the protocols order, if the user desires that, they can maintain their own lists.
Each layer would maintain its own internal order, which would also be consistent with
LCompositor::surfaces()
(containing all surfaces).If the user disables the wlr-layer-shell protocol, everything would remain the same, but there simply wouldn't be any surfaces with that role.
Each surface would have a method to access its current layer and a virtual method that would notify when it changes layers.
The idea of implementing everything this way is to maintain the current API (which in my opinion is simple for the user, although not so much for Louvre internals), but before implementing it, I would like to have your feedback.
Regards
Beta Was this translation helpful? Give feedback.
All reactions