From 0ad5059b6f5f7d1b7cf6df70e3e3bb8dce8ff797 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Fri, 18 Dec 2015 18:38:12 +0100 Subject: [PATCH 1/2] layout: arrange_windows: Fix/better debug output. --- sway/layout.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sway/layout.c b/sway/layout.c index 97c857a1..975cb5cb 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -422,10 +422,9 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { switch (container->type) { case C_ROOT: for (i = 0; i < container->children->length; ++i) { - swayc_t *child = container->children->items[i]; - sway_log(L_DEBUG, "Arranging output at %d", x); - arrange_windows_r(child, -1, -1); - x += child->width; + swayc_t *output = container->children->items[i]; + sway_log(L_DEBUG, "Arranging output '%s' at %f,%f", output->name, output->x, output->y); + arrange_windows_r(output, -1, -1); } return; case C_OUTPUT: @@ -456,6 +455,7 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { struct panel_config *config = desktop_shell.panels->items[i]; if (config->output == output->handle) { struct wlc_size size = *wlc_surface_get_size(config->surface); + sway_log(L_DEBUG, "-> Found panel for this workspace: %ux%u, position: %u", size.w, size.h, desktop_shell.panel_position); switch (desktop_shell.panel_position) { case DESKTOP_SHELL_PANEL_POSITION_TOP: y += size.h; height -= size.h; @@ -477,8 +477,7 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { container->y = gap; container->width = width - gap * 2; container->height = height - gap * 2; - sway_log(L_DEBUG, "Arranging workspace #%d at %f, %f", i, container->x, container->y); - + sway_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", container->name, container->x, container->y); } // children are properly handled below break; From f0b3ee6d84ebbf6a7c47cb3c0437c4dc3c87e67b Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Fri, 18 Dec 2015 23:52:19 +0100 Subject: [PATCH 2/2] layout: arrange_windows: Partially fix swaybar irregularties. --- sway/layout.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sway/layout.c b/sway/layout.c index 975cb5cb..5b7dc486 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -450,7 +450,7 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { case C_WORKSPACE: { swayc_t *output = swayc_parent_by_type(container, C_OUTPUT); - int width = output->width, height = output->height; + width = output->width, height = output->height; for (i = 0; i < desktop_shell.panels->length; ++i) { struct panel_config *config = desktop_shell.panels->items[i]; if (config->output == output->handle) { @@ -473,10 +473,10 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { } } int gap = swayc_gap(container); - container->x = gap; - container->y = gap; - container->width = width - gap * 2; - container->height = height - gap * 2; + container->x = x + gap; + container->y = y + gap; + width = container->width = width - gap * 2; + height = container->height = height - gap * 2; sway_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", container->name, container->x, container->y); } // children are properly handled below