diff --git a/src/interfaces/window.cpp b/src/interfaces/window.cpp
index 5dbd8cc..e387cb4 100644
--- a/src/interfaces/window.cpp
+++ b/src/interfaces/window.cpp
@@ -28,6 +28,7 @@ public:
QString scope = QStringLiteral("window");
Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight};
int32_t exclusionZone = 0;
+ Window::Anchor exclusiveEdge = Window::AnchorNone;
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityOnDemand;
Window::Layer layer = Window::LayerTop;
QMargins margins;
@@ -68,6 +69,21 @@ int32_t Window::exclusionZone() const
return d->exclusionZone;
}
+void Window::setExclusiveEdge(Window::Anchor edge)
+{
+ if (d->exclusiveEdge == edge) {
+ return;
+ }
+
+ d->exclusiveEdge = edge;
+ Q_EMIT exclusiveEdgeChanged();
+}
+
+Window::Anchor Window::exclusiveEdge() const
+{
+ return d->exclusiveEdge;
+}
+
void Window::setMargins(const QMargins &margins)
{
if (d->margins != margins) {
diff --git a/src/interfaces/window.h b/src/interfaces/window.h
index 8a5bf95..9b476a4 100644
--- a/src/interfaces/window.h
+++ b/src/interfaces/window.h
@@ -33,6 +33,7 @@ public:
~Window() override;
enum Anchor {
+ AnchorNone = 0,
AnchorTop = 1, ///< The top edge of the anchor rectangle
AnchorBottom = 2, ///< The bottom edge of the anchor rectangle
AnchorLeft = 4, ///< The left edge of the anchor rectangle
@@ -79,6 +80,9 @@ public:
void setExclusiveZone(int32_t zone);
int32_t exclusionZone() const;
+ void setExclusiveEdge(Window::Anchor edge);
+ Window::Anchor exclusiveEdge() const;
+
void setMargins(const QMargins &margins);
QMargins margins() const;
@@ -121,6 +125,7 @@ public:
Q_SIGNALS:
void anchorsChanged();
void exclusionZoneChanged();
+ void exclusiveEdgeChanged();
void marginsChanged();
void keyboardInteractivityChanged();
void layerChanged();
diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp
index 89f47ef..16cb428 100644
--- a/src/qwaylandlayersurface.cpp
+++ b/src/qwaylandlayersurface.cpp
@@ -48,6 +48,10 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell,
connect(m_interface, &Window::exclusionZoneChanged, this, [this]() {
setExclusiveZone(m_interface->exclusionZone());
});
+ setExclusiveEdge(m_interface->exclusiveEdge());
+ connect(m_interface, &Window::exclusiveEdgeChanged, this, [this]() {
+ setExclusiveEdge(m_interface->exclusiveEdge());
+ });
setMargins(m_interface->margins());
connect(m_interface, &Window::marginsChanged, this, [this]() {
@@ -127,6 +131,11 @@ void QWaylandLayerSurface::setExclusiveZone(int32_t zone)
set_exclusive_zone(zone);
}
+void QWaylandLayerSurface::setExclusiveEdge(uint32_t edge)
+{
+ set_exclusive_edge(edge);
+}
+
void QWaylandLayerSurface::setMargins(const QMargins &margins)
{
set_margin(margins.top(), margins.right(), margins.bottom(), margins.left());
diff --git a/src/qwaylandlayersurface_p.h b/src/qwaylandlayersurface_p.h
index 9ccf819..c61e514 100644
--- a/src/qwaylandlayersurface_p.h
+++ b/src/qwaylandlayersurface_p.h
@@ -36,6 +36,7 @@ public:
void setAnchor(uint32_t anchor);
void setExclusiveZone(int32_t zone);
+ void setExclusiveEdge(uint32_t edge);
void setMargins(const QMargins &margins);
void setKeyboardInteractivity(uint32_t interactivity);
void setLayer(uint32_t layer);
diff --git a/src/wlr-layer-shell-unstable-v1.xml b/src/wlr-layer-shell-unstable-v1.xml
index b53f7a8..1a0c434 100644
--- a/src/wlr-layer-shell-unstable-v1.xml
+++ b/src/wlr-layer-shell-unstable-v1.xml
@@ -187,6 +187,10 @@
+
+
+
+
Requests that the surface be placed some distance away from the anchor