From 479ff58f84876cb3f4d7d8e8e2d0fa2c73e4484d Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 13 Jul 2025 17:08:12 -0700 Subject: [PATCH] wayland/layershell: support opposite-to-exclusion edge margins --- src/wayland/wlr_layershell/wlr_layershell.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wayland/wlr_layershell/wlr_layershell.cpp b/src/wayland/wlr_layershell/wlr_layershell.cpp index 0960ca58..e4726b5c 100644 --- a/src/wayland/wlr_layershell/wlr_layershell.cpp +++ b/src/wayland/wlr_layershell/wlr_layershell.cpp @@ -21,11 +21,16 @@ WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) { case ExclusionMode::Ignore: return -1; case ExclusionMode::Normal: return this->bExclusiveZone; case ExclusionMode::Auto: - const auto edge = this->bcExclusionEdge.value(); + const auto margins = this->bMargins.value(); - if (edge == Qt::TopEdge || edge == Qt::BottomEdge) return this->bImplicitHeight; - else if (edge == Qt::LeftEdge || edge == Qt::RightEdge) return this->bImplicitWidth; - else return 0; + // add reverse edge margins which are ignored by wlr-layer-shell + switch (this->bcExclusionEdge.value()) { + case Qt::TopEdge: return this->bImplicitHeight + margins.bottom; + case Qt::BottomEdge: return this->bImplicitHeight + margins.top; + case Qt::LeftEdge: return this->bImplicitHeight + margins.right; + case Qt::RightEdge: return this->bImplicitHeight + margins.left; + default: return 0; + } } });