diff options
author | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
commit | 63b4bf500020cf35cebfdce2d73f8e359ff495c2 (patch) | |
tree | 76624b3d4820551261e5c15f773c403c1a41264e /sway/tree/arrange.c | |
parent | Merge pull request #2223 from RyanDwyer/floating-move (diff) | |
download | sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.gz sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.zst sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.zip |
Update for swaywm/wlroots#1126
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r-- | sway/tree/arrange.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 582b2891..bcc3ee9a 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c | |||
@@ -47,11 +47,11 @@ static void apply_horiz_layout(struct sway_container *parent) { | |||
47 | double scale = parent->width / total_width; | 47 | double scale = parent->width / total_width; |
48 | 48 | ||
49 | // Resize windows | 49 | // Resize windows |
50 | wlr_log(L_DEBUG, "Arranging %p horizontally", parent); | 50 | wlr_log(WLR_DEBUG, "Arranging %p horizontally", parent); |
51 | double child_x = parent->x; | 51 | double child_x = parent->x; |
52 | for (size_t i = 0; i < num_children; ++i) { | 52 | for (size_t i = 0; i < num_children; ++i) { |
53 | struct sway_container *child = parent->children->items[i]; | 53 | struct sway_container *child = parent->children->items[i]; |
54 | wlr_log(L_DEBUG, | 54 | wlr_log(WLR_DEBUG, |
55 | "Calculating arrangement for %p:%d (will scale %f by %f)", | 55 | "Calculating arrangement for %p:%d (will scale %f by %f)", |
56 | child, child->type, child->width, scale); | 56 | child, child->type, child->width, scale); |
57 | child->x = child_x; | 57 | child->x = child_x; |
@@ -99,11 +99,11 @@ static void apply_vert_layout(struct sway_container *parent) { | |||
99 | double scale = parent_height / total_height; | 99 | double scale = parent_height / total_height; |
100 | 100 | ||
101 | // Resize | 101 | // Resize |
102 | wlr_log(L_DEBUG, "Arranging %p vertically", parent); | 102 | wlr_log(WLR_DEBUG, "Arranging %p vertically", parent); |
103 | double child_y = parent->y + parent_offset; | 103 | double child_y = parent->y + parent_offset; |
104 | for (size_t i = 0; i < num_children; ++i) { | 104 | for (size_t i = 0; i < num_children; ++i) { |
105 | struct sway_container *child = parent->children->items[i]; | 105 | struct sway_container *child = parent->children->items[i]; |
106 | wlr_log(L_DEBUG, | 106 | wlr_log(WLR_DEBUG, |
107 | "Calculating arrangement for %p:%d (will scale %f by %f)", | 107 | "Calculating arrangement for %p:%d (will scale %f by %f)", |
108 | child, child->type, child->height, scale); | 108 | child, child->type, child->height, scale); |
109 | child->x = parent->x; | 109 | child->x = parent->x; |
@@ -179,7 +179,7 @@ static void arrange_children_of(struct sway_container *parent, | |||
179 | if (config->reloading) { | 179 | if (config->reloading) { |
180 | return; | 180 | return; |
181 | } | 181 | } |
182 | wlr_log(L_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent, | 182 | wlr_log(WLR_DEBUG, "Arranging layout for %p %s %fx%f+%f,%f", parent, |
183 | parent->name, parent->width, parent->height, parent->x, parent->y); | 183 | parent->name, parent->width, parent->height, parent->x, parent->y); |
184 | 184 | ||
185 | // Calculate x, y, width and height of children | 185 | // Calculate x, y, width and height of children |
@@ -226,7 +226,7 @@ static void arrange_workspace(struct sway_container *workspace, | |||
226 | } | 226 | } |
227 | struct sway_container *output = workspace->parent; | 227 | struct sway_container *output = workspace->parent; |
228 | struct wlr_box *area = &output->sway_output->usable_area; | 228 | struct wlr_box *area = &output->sway_output->usable_area; |
229 | wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 229 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", |
230 | area->width, area->height, area->x, area->y); | 230 | area->width, area->height, area->x, area->y); |
231 | remove_gaps(workspace); | 231 | remove_gaps(workspace); |
232 | workspace->width = area->width; | 232 | workspace->width = area->width; |
@@ -235,7 +235,7 @@ static void arrange_workspace(struct sway_container *workspace, | |||
235 | workspace->y = output->y + area->y; | 235 | workspace->y = output->y + area->y; |
236 | add_gaps(workspace); | 236 | add_gaps(workspace); |
237 | transaction_add_container(transaction, workspace); | 237 | transaction_add_container(transaction, workspace); |
238 | wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, | 238 | wlr_log(WLR_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, |
239 | workspace->x, workspace->y); | 239 | workspace->x, workspace->y); |
240 | arrange_floating(workspace->sway_workspace->floating, transaction); | 240 | arrange_floating(workspace->sway_workspace->floating, transaction); |
241 | arrange_children_of(workspace, transaction); | 241 | arrange_children_of(workspace, transaction); |
@@ -254,7 +254,7 @@ static void arrange_output(struct sway_container *output, | |||
254 | output->width = output_box->width; | 254 | output->width = output_box->width; |
255 | output->height = output_box->height; | 255 | output->height = output_box->height; |
256 | transaction_add_container(transaction, output); | 256 | transaction_add_container(transaction, output); |
257 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", | 257 | wlr_log(WLR_DEBUG, "Arranging output '%s' at %f,%f", |
258 | output->name, output->x, output->y); | 258 | output->name, output->x, output->y); |
259 | for (int i = 0; i < output->children->length; ++i) { | 259 | for (int i = 0; i < output->children->length; ++i) { |
260 | struct sway_container *workspace = output->children->items[i]; | 260 | struct sway_container *workspace = output->children->items[i]; |
@@ -315,7 +315,7 @@ void arrange_and_commit(struct sway_container *container) { | |||
315 | 315 | ||
316 | void remove_gaps(struct sway_container *c) { | 316 | void remove_gaps(struct sway_container *c) { |
317 | if (c->current_gaps == 0) { | 317 | if (c->current_gaps == 0) { |
318 | wlr_log(L_DEBUG, "Removing gaps: not gapped: %p", c); | 318 | wlr_log(WLR_DEBUG, "Removing gaps: not gapped: %p", c); |
319 | return; | 319 | return; |
320 | } | 320 | } |
321 | 321 | ||
@@ -326,12 +326,12 @@ void remove_gaps(struct sway_container *c) { | |||
326 | 326 | ||
327 | c->current_gaps = 0; | 327 | c->current_gaps = 0; |
328 | 328 | ||
329 | wlr_log(L_DEBUG, "Removing gaps %p", c); | 329 | wlr_log(WLR_DEBUG, "Removing gaps %p", c); |
330 | } | 330 | } |
331 | 331 | ||
332 | void add_gaps(struct sway_container *c) { | 332 | void add_gaps(struct sway_container *c) { |
333 | if (c->current_gaps > 0 || c->type == C_CONTAINER) { | 333 | if (c->current_gaps > 0 || c->type == C_CONTAINER) { |
334 | wlr_log(L_DEBUG, "Not adding gaps: %p", c); | 334 | wlr_log(WLR_DEBUG, "Not adding gaps: %p", c); |
335 | return; | 335 | return; |
336 | } | 336 | } |
337 | 337 | ||
@@ -348,5 +348,5 @@ void add_gaps(struct sway_container *c) { | |||
348 | c->height -= 2 * gaps; | 348 | c->height -= 2 * gaps; |
349 | c->current_gaps = gaps; | 349 | c->current_gaps = gaps; |
350 | 350 | ||
351 | wlr_log(L_DEBUG, "Adding gaps: %p", c); | 351 | wlr_log(WLR_DEBUG, "Adding gaps: %p", c); |
352 | } | 352 | } |