aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-11-29 12:03:13 -0500
committerDrew DeVault <sir@cmpwn.com>2015-11-29 12:03:13 -0500
commite59cffcea2a881f16de3716c6b24d93aceb8c79a (patch)
treea09447b6eb903573edb598c7b80ac7c3c492dee5 /sway/layout.c
parent60e76cf932e7b4d240af1f994a868e9f587c056d (diff)
Support desktop shell panels in compositor
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c
index de186886..70980ec3 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <wlc/wlc.h>
+#include "extensions.h"
#include "layout.h"
#include "log.h"
#include "list.h"
@@ -426,6 +427,27 @@ static void arrange_windows_r(swayc_t *container, double width, double height) {
}
return;
case C_OUTPUT:
+ for (i = 0; i < desktop_shell.panels->length; ++i) {
+ struct panel_config *config = desktop_shell.panels->items[i];
+ if (config->output == container->handle) {
+ struct wlc_size size = *wlc_surface_get_size(config->surface);
+ switch (desktop_shell.panel_position) {
+ case DESKTOP_SHELL_PANEL_POSITION_TOP:
+ y += size.h; height -= size.h;
+ break;
+ case DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
+ height -= size.h;
+ break;
+ case DESKTOP_SHELL_PANEL_POSITION_LEFT:
+ x += size.w; width -= size.w;
+ break;
+ case DESKTOP_SHELL_PANEL_POSITION_RIGHT:
+ width -= size.w;
+ break;
+ }
+ }
+ }
+
container->width = width;
container->height = height;
x = 0, y = 0;