From 8bd3b7be8ac3194e1f6a7620dd2782b3b3def1e1 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 12 Aug 2019 01:18:24 +0200 Subject: [PATCH] layer_shell: Guard against negative exclusive zone This can happen with surfaces that set negative margins. --- sway/desktop/layer_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }