aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-07 13:21:52 -0400
committerGitHub <noreply@github.com>2018-04-07 13:21:52 -0400
commita5d06b6e2b52d535fca25adf143f27233a3609c5 (patch)
treebd33d9f21a6e7e9b2cde9efdee196c162762b953 /sway/tree
parent5d34e4531f03c194fd2b3717fd4cc4a802ada7aa (diff)
parent61abd56ca4949db5e2dab4806656d814e1cb423d (diff)
Merge pull request #1766 from emersion/fix-output-container-position
Fix output containers position
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/layout.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 78af8b8c..e81facc6 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -30,26 +30,7 @@ static void output_layout_handle_change(struct wl_listener *listener,
root_container.width = layout_box->width;
root_container.height = layout_box->height;
- for (int i = 0 ; i < root_container.children->length; ++i) {
- struct sway_container *output_container =
- root_container.children->items[i];
- if (output_container->type != C_OUTPUT) {
- continue;
- }
- struct sway_output *output = output_container->sway_output;
-
- const struct wlr_box *output_box =
- wlr_output_layout_get_box(output_layout, output->wlr_output);
- if (!output_box) {
- continue;
- }
- output_container->x = output_box->x;
- output_container->y = output_box->y;
- output_container->width = output_box->width;
- output_container->height = output_box->height;
- }
-
- arrange_windows(&root_container, -1, -1);
+ arrange_windows(&root_container, layout_box->width, layout_box->height);
}
struct sway_container *container_set_layout(struct sway_container *container,
@@ -551,19 +532,19 @@ void arrange_windows(struct sway_container *container,
case C_ROOT:
for (i = 0; i < container->children->length; ++i) {
struct sway_container *output = container->children->items[i];
+ const struct wlr_box *output_box = wlr_output_layout_get_box(
+ container->sway_root->output_layout,
+ output->sway_output->wlr_output);
+ output->x = output_box->x;
+ output->y = output_box->y;
+ output->width = output_box->width;
+ output->height = output_box->height;
wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f",
output->name, output->x, output->y);
- arrange_windows(output, -1, -1);
+ arrange_windows(output, output_box->width, output_box->height);
}
return;
case C_OUTPUT:
- {
- int _width, _height;
- wlr_output_effective_resolution(
- container->sway_output->wlr_output, &_width, &_height);
- width = container->width = _width;
- height = container->height = _height;
- }
// arrange all workspaces:
for (i = 0; i < container->children->length; ++i) {
struct sway_container *child = container->children->items[i];