summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>2019-08-12 01:18:24 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-20 13:27:52 +0900
commit8bd3b7be8ac3194e1f6a7620dd2782b3b3def1e1 (patch)
tree682975f4e35d09550da8bfa06c2d2ffa7c903047
parent6200ecbc1dd85c3fb294c6a6618645b7f0a106c9 (diff)
layer_shell: Guard against negative exclusive zone
This can happen with surfaces that set negative margins.
-rw-r--r--sway/desktop/layer_shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index ed00b2825..34ba55922 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -68,7 +68,7 @@ static void apply_exclusive(struct wlr_box *usable_area,
},
};
for (size_t i = 0; i < sizeof(edges) / sizeof(edges[0]); ++i) {
- if ((anchor & edges[i].anchors) == edges[i].anchors) {
+ if ((anchor & edges[i].anchors) == edges[i].anchors && exclusive + edges[i].margin > 0) {
if (edges[i].positive_axis) {
*edges[i].positive_axis += exclusive + edges[i].margin;
}