Skip to content

Commit 479ff58

Browse files
committed
wayland/layershell: support opposite-to-exclusion edge margins
1 parent 3b4ebc5 commit 479ff58

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/wayland/wlr_layershell/wlr_layershell.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) {
2121
case ExclusionMode::Ignore: return -1;
2222
case ExclusionMode::Normal: return this->bExclusiveZone;
2323
case ExclusionMode::Auto:
24-
const auto edge = this->bcExclusionEdge.value();
25-
26-
if (edge == Qt::TopEdge || edge == Qt::BottomEdge) return this->bImplicitHeight;
27-
else if (edge == Qt::LeftEdge || edge == Qt::RightEdge) return this->bImplicitWidth;
28-
else return 0;
24+
const auto margins = this->bMargins.value();
25+
26+
// add reverse edge margins which are ignored by wlr-layer-shell
27+
switch (this->bcExclusionEdge.value()) {
28+
case Qt::TopEdge: return this->bImplicitHeight + margins.bottom;
29+
case Qt::BottomEdge: return this->bImplicitHeight + margins.top;
30+
case Qt::LeftEdge: return this->bImplicitHeight + margins.right;
31+
case Qt::RightEdge: return this->bImplicitHeight + margins.left;
32+
default: return 0;
33+
}
2934
}
3035
});
3136

0 commit comments

Comments
 (0)