From a58c092faf2daa88fa39152ad33c0a3c92959ec6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2024 10:08:01 +0200 Subject: [PATCH] Add set_accomodate_exclusive_zones Right now a layer shell surface can be set to not be moved and resized by the areas reserved by exclusive zones owned by otther surfaces by setting a magic value of -1 to the exclusive_zone property. Besides not being a clear API, this has the limitation of allowing a layershell surface to not be moved only if it does not have any exclusive zone by itself, which is ok for "desktop" windows but not for panels. On a shell where we have all the panels in the same process we know their layout and things are much more controllable if is the client side which asks the panels to be sized correctly It also becomes possible for more panels to be on the same side, for instance one aligned to the left and one aligned to the right, thing that we do support in Plasma on X11 --- unstable/wlr-layer-shell-unstable-v1.xml | 39 ++++++++++++++++++------ 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/unstable/wlr-layer-shell-unstable-v1.xml b/unstable/wlr-layer-shell-unstable-v1.xml index e9f27e4..4bebb05 100644 --- a/unstable/wlr-layer-shell-unstable-v1.xml +++ b/unstable/wlr-layer-shell-unstable-v1.xml @@ -25,7 +25,7 @@ THIS SOFTWARE. - + Clients can use this interface to assign the surface_layer role to wl_surfaces. Such surfaces are assigned to a "layer" of the output and @@ -100,7 +100,7 @@ - + An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like @@ -168,21 +168,25 @@ Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding - surfaces with a positive exclusive zone. If set to -1, the surface - indicates that it would not like to be moved to accommodate for other - surfaces, and the compositor should extend it all the way to the edges - it is anchored to. + surfaces with a positive exclusive zone. For example, a panel might set its exclusive zone to 10, so that maximized shell surfaces are not shown on top of it. A notification might set its exclusive zone to 0, so that it is moved to avoid - occluding the panel, but shell surfaces are shown underneath it. A - wallpaper or lock screen might set their exclusive zone to -1, so that - they stretch below or over the panel. + occluding the panel, but shell surfaces are shown underneath it. The default value is 0. Exclusive zone is double-buffered, see wl_surface.commit. + + Since version 6 It must be a value of 0 or more, otherwise the error + invalid_exclusive_zone will be triggered. + + Until version 5 if set to -1, the surface indicates that it would not + like to be moved to accommodate for other surfaces, and the compositor + should extend it all the way to the edges it is anchored to. + A wallpaper or lock screen might set their exclusive zone to -1, so that + they stretch below or over the panel. @@ -368,6 +372,7 @@ + @@ -403,5 +408,21 @@ + + + + + + Asks for this surface to not be automatically moved and resized according to + exclusive zones claimed by other surfaces. + + The accomodate parameter is treated as a boolean flag, a zero value means false, + a non zero value means true. + + This is the default behavior, if you want a zone to not be automatically moved, + explicitly call this with 0 as parameter. + + +