aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-07-09 22:54:30 +0100
committerLibravatar emersion <contact@emersion.fr>2018-07-09 22:54:30 +0100
commit63b4bf500020cf35cebfdce2d73f8e359ff495c2 (patch)
tree76624b3d4820551261e5c15f773c403c1a41264e /sway/tree
parentMerge pull request #2223 from RyanDwyer/floating-move (diff)
downloadsway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.gz
sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.zst
sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.zip
Update for swaywm/wlroots#1126
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/arrange.c24
-rw-r--r--sway/tree/container.c16
-rw-r--r--sway/tree/layout.c56
-rw-r--r--sway/tree/output.c6
-rw-r--r--sway/tree/view.c14
-rw-r--r--sway/tree/workspace.c14
6 files changed, 65 insertions, 65 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
316void remove_gaps(struct sway_container *c) { 316void 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
332void add_gaps(struct sway_container *c) { 332void 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}
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 92408ce6..58852717 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -31,7 +31,7 @@ static list_t *get_bfs_queue() {
31 if (!bfs_queue) { 31 if (!bfs_queue) {
32 bfs_queue = create_list(); 32 bfs_queue = create_list();
33 if (!bfs_queue) { 33 if (!bfs_queue) {
34 wlr_log(L_ERROR, "could not allocate list for bfs queue"); 34 wlr_log(WLR_ERROR, "could not allocate list for bfs queue");
35 return NULL; 35 return NULL;
36 } 36 }
37 } 37 }
@@ -213,7 +213,7 @@ static struct sway_container *container_workspace_destroy(
213 return NULL; 213 return NULL;
214 } 214 }
215 215
216 wlr_log(L_DEBUG, "destroying workspace '%s'", workspace->name); 216 wlr_log(WLR_DEBUG, "destroying workspace '%s'", workspace->name);
217 217
218 struct sway_container *parent = workspace->parent; 218 struct sway_container *parent = workspace->parent;
219 if (!workspace_is_empty(workspace) && output) { 219 if (!workspace_is_empty(workspace) && output) {
@@ -226,7 +226,7 @@ static struct sway_container *container_workspace_destroy(
226 } 226 }
227 } 227 }
228 228
229 wlr_log(L_DEBUG, "moving children to different workspace '%s' -> '%s'", 229 wlr_log(WLR_DEBUG, "moving children to different workspace '%s' -> '%s'",
230 workspace->name, new_workspace->name); 230 workspace->name, new_workspace->name);
231 for (int i = 0; i < workspace->children->length; i++) { 231 for (int i = 0; i < workspace->children->length; i++) {
232 container_move_to(workspace->children->items[i], new_workspace); 232 container_move_to(workspace->children->items[i], new_workspace);
@@ -292,7 +292,7 @@ static struct sway_container *container_output_destroy(
292 output->sway_output->swayc = NULL; 292 output->sway_output->swayc = NULL;
293 output->sway_output = NULL; 293 output->sway_output = NULL;
294 294
295 wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); 295 wlr_log(WLR_DEBUG, "OUTPUT: Destroying output '%s'", output->name);
296 296
297 return &root_container; 297 return &root_container;
298} 298}
@@ -319,7 +319,7 @@ static struct sway_container *container_destroy_noreaping(
319 // Workspaces will refuse to be destroyed if they're the last workspace 319 // Workspaces will refuse to be destroyed if they're the last workspace
320 // on their output. 320 // on their output.
321 if (!container_workspace_destroy(con)) { 321 if (!container_workspace_destroy(con)) {
322 wlr_log(L_ERROR, "workspace doesn't want to destroy"); 322 wlr_log(WLR_ERROR, "workspace doesn't want to destroy");
323 return NULL; 323 return NULL;
324 } 324 }
325 } 325 }
@@ -346,7 +346,7 @@ bool container_reap_empty(struct sway_container *con) {
346 break; 346 break;
347 case C_WORKSPACE: 347 case C_WORKSPACE:
348 if (!workspace_is_visible(con) && workspace_is_empty(con)) { 348 if (!workspace_is_visible(con) && workspace_is_empty(con)) {
349 wlr_log(L_DEBUG, "Destroying workspace via reaper"); 349 wlr_log(WLR_DEBUG, "Destroying workspace via reaper");
350 container_destroy_noreaping(con); 350 container_destroy_noreaping(con);
351 return true; 351 return true;
352 } 352 }
@@ -439,7 +439,7 @@ struct sway_container *container_view_create(struct sway_container *sibling,
439 } 439 }
440 const char *title = view_get_title(sway_view); 440 const char *title = view_get_title(sway_view);
441 struct sway_container *swayc = container_create(C_VIEW); 441 struct sway_container *swayc = container_create(C_VIEW);
442 wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d %s", 442 wlr_log(WLR_DEBUG, "Adding new view %p:%s to container %p %d %s",
443 swayc, title, sibling, sibling ? sibling->type : 0, sibling->name); 443 swayc, title, sibling, sibling ? sibling->type : 0, sibling->name);
444 // Setup values 444 // Setup values
445 swayc->sway_view = sway_view; 445 swayc->sway_view = sway_view;
@@ -702,7 +702,7 @@ void container_for_each_descendant_bfs(struct sway_container *con,
702 } 702 }
703 703
704 if (queue == NULL) { 704 if (queue == NULL) {
705 wlr_log(L_ERROR, "could not allocate list"); 705 wlr_log(WLR_ERROR, "could not allocate list");
706 return; 706 return;
707 } 707 }
708 708
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 0dba4aab..ba234e89 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -101,7 +101,7 @@ void container_insert_child(struct sway_container *parent,
101 if (old_parent) { 101 if (old_parent) {
102 container_remove_child(child); 102 container_remove_child(child);
103 } 103 }
104 wlr_log(L_DEBUG, "Inserting id:%zd at index %d", child->id, i); 104 wlr_log(WLR_DEBUG, "Inserting id:%zd at index %d", child->id, i);
105 list_insert(parent->children, i, child); 105 list_insert(parent->children, i, child);
106 child->parent = parent; 106 child->parent = parent;
107 container_handle_fullscreen_reparent(child, old_parent); 107 container_handle_fullscreen_reparent(child, old_parent);
@@ -127,7 +127,7 @@ struct sway_container *container_add_sibling(struct sway_container *fixed,
127 127
128void container_add_child(struct sway_container *parent, 128void container_add_child(struct sway_container *parent,
129 struct sway_container *child) { 129 struct sway_container *child) {
130 wlr_log(L_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)", 130 wlr_log(WLR_DEBUG, "Adding %p (%d, %fx%f) to %p (%d, %fx%f)",
131 child, child->type, child->width, child->height, 131 child, child->type, child->width, child->height,
132 parent, parent->type, parent->width, parent->height); 132 parent, parent->type, parent->width, parent->height);
133 struct sway_container *old_parent = child->parent; 133 struct sway_container *old_parent = child->parent;
@@ -319,13 +319,13 @@ static void move_out_of_tabs_stacks(struct sway_container *container,
319 int offs) { 319 int offs) {
320 if (container->parent == current->parent 320 if (container->parent == current->parent
321 && current->parent->children->length == 1) { 321 && current->parent->children->length == 1) {
322 wlr_log(L_DEBUG, "Changing layout of %zd", current->parent->id); 322 wlr_log(WLR_DEBUG, "Changing layout of %zd", current->parent->id);
323 current->parent->layout = move_dir == 323 current->parent->layout = move_dir ==
324 MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; 324 MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT;
325 return; 325 return;
326 } 326 }
327 327
328 wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); 328 wlr_log(WLR_DEBUG, "Moving out of tab/stack into a split");
329 bool is_workspace = current->parent->type == C_WORKSPACE; 329 bool is_workspace = current->parent->type == C_WORKSPACE;
330 struct sway_container *new_parent = container_split(current->parent, 330 struct sway_container *new_parent = container_split(current->parent,
331 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT); 331 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT);
@@ -370,7 +370,7 @@ void container_move(struct sway_container *container,
370 } 370 }
371 371
372 parent = current->parent; 372 parent = current->parent;
373 wlr_log(L_DEBUG, "Visiting %p %s '%s'", current, 373 wlr_log(WLR_DEBUG, "Visiting %p %s '%s'", current,
374 container_type_to_str(current->type), current->name); 374 container_type_to_str(current->type), current->name);
375 375
376 int index = index_child(current); 376 int index = index_child(current);
@@ -388,12 +388,12 @@ void container_move(struct sway_container *container,
388 root_container.sway_root->output_layout, wlr_dir, 388 root_container.sway_root->output_layout, wlr_dir,
389 current->sway_output->wlr_output, ref_lx, ref_ly); 389 current->sway_output->wlr_output, ref_lx, ref_ly);
390 if (!next) { 390 if (!next) {
391 wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go"); 391 wlr_log(WLR_DEBUG, "Hit edge of output, nowhere else to go");
392 return; 392 return;
393 } 393 }
394 struct sway_output *next_output = next->data; 394 struct sway_output *next_output = next->data;
395 current = next_output->swayc; 395 current = next_output->swayc;
396 wlr_log(L_DEBUG, "Selected next output (%s)", current->name); 396 wlr_log(WLR_DEBUG, "Selected next output (%s)", current->name);
397 // Select workspace and get outta here 397 // Select workspace and get outta here
398 current = seat_get_focus_inactive( 398 current = seat_get_focus_inactive(
399 config->handler_context.seat, current); 399 config->handler_context.seat, current);
@@ -406,20 +406,20 @@ void container_move(struct sway_container *container,
406 case C_WORKSPACE: 406 case C_WORKSPACE:
407 if (!is_parallel(current->layout, move_dir)) { 407 if (!is_parallel(current->layout, move_dir)) {
408 if (current->children->length >= 2) { 408 if (current->children->length >= 2) {
409 wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", 409 wlr_log(WLR_DEBUG, "Rejiggering the workspace (%d kiddos)",
410 current->children->length); 410 current->children->length);
411 workspace_rejigger(current, container, move_dir); 411 workspace_rejigger(current, container, move_dir);
412 return; 412 return;
413 } else { 413 } else {
414 wlr_log(L_DEBUG, "Selecting output"); 414 wlr_log(WLR_DEBUG, "Selecting output");
415 current = current->parent; 415 current = current->parent;
416 } 416 }
417 } else if (current->layout == L_TABBED 417 } else if (current->layout == L_TABBED
418 || current->layout == L_STACKED) { 418 || current->layout == L_STACKED) {
419 wlr_log(L_DEBUG, "Rejiggering out of tabs/stacks"); 419 wlr_log(WLR_DEBUG, "Rejiggering out of tabs/stacks");
420 workspace_rejigger(current, container, move_dir); 420 workspace_rejigger(current, container, move_dir);
421 } else { 421 } else {
422 wlr_log(L_DEBUG, "Selecting output"); 422 wlr_log(WLR_DEBUG, "Selecting output");
423 current = current->parent; 423 current = current->parent;
424 } 424 }
425 break; 425 break;
@@ -435,11 +435,11 @@ void container_move(struct sway_container *container,
435 move_dir, offs); 435 move_dir, offs);
436 return; 436 return;
437 } else { 437 } else {
438 wlr_log(L_DEBUG, "Hit limit, selecting parent"); 438 wlr_log(WLR_DEBUG, "Hit limit, selecting parent");
439 current = current->parent; 439 current = current->parent;
440 } 440 }
441 } else { 441 } else {
442 wlr_log(L_DEBUG, "Hit limit, " 442 wlr_log(WLR_DEBUG, "Hit limit, "
443 "promoting descendant to sibling"); 443 "promoting descendant to sibling");
444 // Special case 444 // Special case
445 container_insert_child(current->parent, container, 445 container_insert_child(current->parent, container,
@@ -449,14 +449,14 @@ void container_move(struct sway_container *container,
449 } 449 }
450 } else { 450 } else {
451 sibling = parent->children->items[index + offs]; 451 sibling = parent->children->items[index + offs];
452 wlr_log(L_DEBUG, "Selecting sibling id:%zd", sibling->id); 452 wlr_log(WLR_DEBUG, "Selecting sibling id:%zd", sibling->id);
453 } 453 }
454 } else if (parent->layout == L_TABBED 454 } else if (parent->layout == L_TABBED
455 || parent->layout == L_STACKED) { 455 || parent->layout == L_STACKED) {
456 move_out_of_tabs_stacks(container, current, move_dir, offs); 456 move_out_of_tabs_stacks(container, current, move_dir, offs);
457 return; 457 return;
458 } else { 458 } else {
459 wlr_log(L_DEBUG, "Moving up to find a parallel container"); 459 wlr_log(WLR_DEBUG, "Moving up to find a parallel container");
460 current = current->parent; 460 current = current->parent;
461 } 461 }
462 break; 462 break;
@@ -475,11 +475,11 @@ void container_move(struct sway_container *container,
475 switch (sibling->type) { 475 switch (sibling->type) {
476 case C_VIEW: 476 case C_VIEW:
477 if (sibling->parent == container->parent) { 477 if (sibling->parent == container->parent) {
478 wlr_log(L_DEBUG, "Swapping siblings"); 478 wlr_log(WLR_DEBUG, "Swapping siblings");
479 sibling->parent->children->items[index + offs] = container; 479 sibling->parent->children->items[index + offs] = container;
480 sibling->parent->children->items[index] = sibling; 480 sibling->parent->children->items[index] = sibling;
481 } else { 481 } else {
482 wlr_log(L_DEBUG, "Promoting to sibling of cousin"); 482 wlr_log(WLR_DEBUG, "Promoting to sibling of cousin");
483 container_insert_child(sibling->parent, container, 483 container_insert_child(sibling->parent, container,
484 index_child(sibling) + (offs > 0 ? 0 : 1)); 484 index_child(sibling) + (offs > 0 ? 0 : 1));
485 container->width = container->height = 0; 485 container->width = container->height = 0;
@@ -490,31 +490,31 @@ void container_move(struct sway_container *container,
490 case C_CONTAINER: 490 case C_CONTAINER:
491 if (is_parallel(sibling->layout, move_dir)) { 491 if (is_parallel(sibling->layout, move_dir)) {
492 int limit = container_limit(sibling, invert_movement(move_dir)); 492 int limit = container_limit(sibling, invert_movement(move_dir));
493 wlr_log(L_DEBUG, "limit: %d", limit); 493 wlr_log(WLR_DEBUG, "limit: %d", limit);
494 wlr_log(L_DEBUG, 494 wlr_log(WLR_DEBUG,
495 "Reparenting container (parallel) to index %d " 495 "Reparenting container (parallel) to index %d "
496 "(move dir: %d)", limit, move_dir); 496 "(move dir: %d)", limit, move_dir);
497 container_insert_child(sibling, container, limit); 497 container_insert_child(sibling, container, limit);
498 container->width = container->height = 0; 498 container->width = container->height = 0;
499 sibling = NULL; 499 sibling = NULL;
500 } else { 500 } else {
501 wlr_log(L_DEBUG, "Reparenting container (perpendicular)"); 501 wlr_log(WLR_DEBUG, "Reparenting container (perpendicular)");
502 struct sway_container *focus_inactive = seat_get_focus_inactive( 502 struct sway_container *focus_inactive = seat_get_focus_inactive(
503 config->handler_context.seat, sibling); 503 config->handler_context.seat, sibling);
504 if (focus_inactive && focus_inactive != sibling) { 504 if (focus_inactive && focus_inactive != sibling) {
505 while (focus_inactive->parent != sibling) { 505 while (focus_inactive->parent != sibling) {
506 focus_inactive = focus_inactive->parent; 506 focus_inactive = focus_inactive->parent;
507 } 507 }
508 wlr_log(L_DEBUG, "Focus inactive: id:%zd", 508 wlr_log(WLR_DEBUG, "Focus inactive: id:%zd",
509 focus_inactive->id); 509 focus_inactive->id);
510 sibling = focus_inactive; 510 sibling = focus_inactive;
511 continue; 511 continue;
512 } else if (sibling->children->length) { 512 } else if (sibling->children->length) {
513 wlr_log(L_DEBUG, "No focus-inactive, adding arbitrarily"); 513 wlr_log(WLR_DEBUG, "No focus-inactive, adding arbitrarily");
514 container_remove_child(container); 514 container_remove_child(container);
515 container_add_sibling(sibling->children->items[0], container); 515 container_add_sibling(sibling->children->items[0], container);
516 } else { 516 } else {
517 wlr_log(L_DEBUG, "No kiddos, adding container alone"); 517 wlr_log(WLR_DEBUG, "No kiddos, adding container alone");
518 container_remove_child(container); 518 container_remove_child(container);
519 container_add_child(sibling, container); 519 container_add_child(sibling, container);
520 } 520 }
@@ -611,7 +611,7 @@ static struct sway_container *get_swayc_in_output_direction(
611 } 611 }
612 612
613 if (ws == NULL) { 613 if (ws == NULL) {
614 wlr_log(L_ERROR, "got an output without a workspace"); 614 wlr_log(WLR_ERROR, "got an output without a workspace");
615 return NULL; 615 return NULL;
616 } 616 }
617 617
@@ -783,7 +783,7 @@ struct sway_container *container_get_in_direction(
783 } else { 783 } else {
784 struct sway_container *desired_con = 784 struct sway_container *desired_con =
785 parent->children->items[desired]; 785 parent->children->items[desired];
786 wlr_log(L_DEBUG, 786 wlr_log(WLR_DEBUG,
787 "cont %d-%p dir %i sibling %d: %p", idx, 787 "cont %d-%p dir %i sibling %d: %p", idx,
788 container, dir, desired, desired_con); 788 container, dir, desired, desired_con);
789 return seat_get_focus_inactive_view(seat, desired_con); 789 return seat_get_focus_inactive_view(seat, desired_con);
@@ -848,7 +848,7 @@ struct sway_container *container_split(struct sway_container *child,
848 848
849 struct sway_container *cont = container_create(C_CONTAINER); 849 struct sway_container *cont = container_create(C_CONTAINER);
850 850
851 wlr_log(L_DEBUG, "creating container %p around %p", cont, child); 851 wlr_log(WLR_DEBUG, "creating container %p around %p", cont, child);
852 852
853 remove_gaps(child); 853 remove_gaps(child);
854 854
@@ -896,7 +896,7 @@ struct sway_container *container_split(struct sway_container *child,
896void container_recursive_resize(struct sway_container *container, 896void container_recursive_resize(struct sway_container *container,
897 double amount, enum resize_edge edge) { 897 double amount, enum resize_edge edge) {
898 bool layout_match = true; 898 bool layout_match = true;
899 wlr_log(L_DEBUG, "Resizing %p with amount: %f", container, amount); 899 wlr_log(WLR_DEBUG, "Resizing %p with amount: %f", container, amount);
900 if (edge == RESIZE_EDGE_LEFT || edge == RESIZE_EDGE_RIGHT) { 900 if (edge == RESIZE_EDGE_LEFT || edge == RESIZE_EDGE_RIGHT) {
901 container->width += amount; 901 container->width += amount;
902 layout_match = container->layout == L_HORIZ; 902 layout_match = container->layout == L_HORIZ;
@@ -986,7 +986,7 @@ void container_swap(struct sway_container *con1, struct sway_container *con2) {
986 return; 986 return;
987 } 987 }
988 988
989 wlr_log(L_DEBUG, "Swapping containers %zu and %zu", con1->id, con2->id); 989 wlr_log(WLR_DEBUG, "Swapping containers %zu and %zu", con1->id, con2->id);
990 990
991 int fs1 = con1->type == C_VIEW && con1->sway_view->is_fullscreen; 991 int fs1 = con1->type == C_VIEW && con1->sway_view->is_fullscreen;
992 int fs2 = con2->type == C_VIEW && con2->sway_view->is_fullscreen; 992 int fs2 = con2->type == C_VIEW && con2->sway_view->is_fullscreen;
diff --git a/sway/tree/output.c b/sway/tree/output.c
index e2927cdb..da535c18 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -43,11 +43,11 @@ struct sway_container *output_create(
43 43
44 if (strcasecmp(name, cur->name) == 0 || 44 if (strcasecmp(name, cur->name) == 0 ||
45 strcasecmp(identifier, cur->name) == 0) { 45 strcasecmp(identifier, cur->name) == 0) {
46 wlr_log(L_DEBUG, "Matched output config for %s", name); 46 wlr_log(WLR_DEBUG, "Matched output config for %s", name);
47 oc = cur; 47 oc = cur;
48 } 48 }
49 if (strcasecmp("*", cur->name) == 0) { 49 if (strcasecmp("*", cur->name) == 0) {
50 wlr_log(L_DEBUG, "Matched wildcard output config for %s", name); 50 wlr_log(WLR_DEBUG, "Matched wildcard output config for %s", name);
51 all = cur; 51 all = cur;
52 } 52 }
53 53
@@ -86,7 +86,7 @@ struct sway_container *output_create(
86 if (!output->children->length) { 86 if (!output->children->length) {
87 // Create workspace 87 // Create workspace
88 char *ws_name = workspace_next_name(output->name); 88 char *ws_name = workspace_next_name(output->name);
89 wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); 89 wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name);
90 struct sway_container *ws = workspace_create(output, ws_name); 90 struct sway_container *ws = workspace_create(output, ws_name);
91 // Set each seat's focus if not already set 91 // Set each seat's focus if not already set
92 struct sway_seat *seat = NULL; 92 struct sway_seat *seat = NULL;
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 3ef79fa8..c96b6a97 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -462,17 +462,17 @@ void view_execute_criteria(struct sway_view *view) {
462 list_t *criterias = criteria_for_view(view, CT_COMMAND); 462 list_t *criterias = criteria_for_view(view, CT_COMMAND);
463 for (int i = 0; i < criterias->length; i++) { 463 for (int i = 0; i < criterias->length; i++) {
464 struct criteria *criteria = criterias->items[i]; 464 struct criteria *criteria = criterias->items[i];
465 wlr_log(L_DEBUG, "Checking criteria %s", criteria->raw); 465 wlr_log(WLR_DEBUG, "Checking criteria %s", criteria->raw);
466 if (view_has_executed_criteria(view, criteria)) { 466 if (view_has_executed_criteria(view, criteria)) {
467 wlr_log(L_DEBUG, "Criteria already executed"); 467 wlr_log(WLR_DEBUG, "Criteria already executed");
468 continue; 468 continue;
469 } 469 }
470 wlr_log(L_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", 470 wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'",
471 criteria->raw, view, criteria->cmdlist); 471 criteria->raw, view, criteria->cmdlist);
472 list_add(view->executed_criteria, criteria); 472 list_add(view->executed_criteria, criteria);
473 struct cmd_results *res = execute_command(criteria->cmdlist, NULL); 473 struct cmd_results *res = execute_command(criteria->cmdlist, NULL);
474 if (res->status != CMD_SUCCESS) { 474 if (res->status != CMD_SUCCESS) {
475 wlr_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error); 475 wlr_log(WLR_ERROR, "Command '%s' failed: %s", res->input, res->error);
476 } 476 }
477 free_cmd_results(res); 477 free_cmd_results(res);
478 // view must be focused for commands to affect it, 478 // view must be focused for commands to affect it,
@@ -601,7 +601,7 @@ static void view_subsurface_create(struct sway_view *view,
601 struct wlr_subsurface *subsurface) { 601 struct wlr_subsurface *subsurface) {
602 struct sway_view_child *child = calloc(1, sizeof(struct sway_view_child)); 602 struct sway_view_child *child = calloc(1, sizeof(struct sway_view_child));
603 if (child == NULL) { 603 if (child == NULL) {
604 wlr_log(L_ERROR, "Allocation failed"); 604 wlr_log(WLR_ERROR, "Allocation failed");
605 return; 605 return;
606 } 606 }
607 view_child_init(child, NULL, view, subsurface->surface); 607 view_child_init(child, NULL, view, subsurface->surface);
@@ -721,7 +721,7 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) {
721 return NULL; 721 return NULL;
722 } 722 }
723 723
724 wlr_log(L_DEBUG, "Surface of unknown type (role %s): %p", 724 wlr_log(WLR_DEBUG, "Surface of unknown type (role %s): %p",
725 wlr_surface->role, wlr_surface); 725 wlr_surface->role, wlr_surface);
726 return NULL; 726 return NULL;
727} 727}
@@ -789,7 +789,7 @@ static char *escape_title(char *buffer) {
789 char *escaped_title = calloc(length + 1, sizeof(char)); 789 char *escaped_title = calloc(length + 1, sizeof(char));
790 int result = escape_markup_text(buffer, escaped_title, length); 790 int result = escape_markup_text(buffer, escaped_title, length);
791 if (result != length) { 791 if (result != length) {
792 wlr_log(L_ERROR, "Could not escape title: %s", buffer); 792 wlr_log(WLR_ERROR, "Could not escape title: %s", buffer);
793 free(escaped_title); 793 free(escaped_title);
794 return buffer; 794 return buffer;
795 } 795 }
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 51f0fcb4..50f9400a 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -49,7 +49,7 @@ struct sway_container *workspace_create(struct sway_container *output,
49 output = get_workspace_initial_output(name); 49 output = get_workspace_initial_output(name);
50 } 50 }
51 51
52 wlr_log(L_DEBUG, "Added workspace %s for output %s", name, output->name); 52 wlr_log(WLR_DEBUG, "Added workspace %s for output %s", name, output->name);
53 struct sway_container *workspace = container_create(C_WORKSPACE); 53 struct sway_container *workspace = container_create(C_WORKSPACE);
54 54
55 workspace->x = output->x; 55 workspace->x = output->x;
@@ -107,7 +107,7 @@ static bool workspace_valid_on_output(const char *output_name,
107} 107}
108 108
109char *workspace_next_name(const char *output_name) { 109char *workspace_next_name(const char *output_name) {
110 wlr_log(L_DEBUG, "Workspace: Generating new workspace name for output %s", 110 wlr_log(WLR_DEBUG, "Workspace: Generating new workspace name for output %s",
111 output_name); 111 output_name);
112 // Scan all workspace bindings to find the next available workspace name, 112 // Scan all workspace bindings to find the next available workspace name,
113 // if none are found/available then default to a number 113 // if none are found/available then default to a number
@@ -135,7 +135,7 @@ char *workspace_next_name(const char *output_name) {
135 while (isspace(*_target)) { 135 while (isspace(*_target)) {
136 memmove(_target, _target+1, strlen(_target+1)); 136 memmove(_target, _target+1, strlen(_target+1));
137 } 137 }
138 wlr_log(L_DEBUG, "Got valid workspace command for target: '%s'", 138 wlr_log(WLR_DEBUG, "Got valid workspace command for target: '%s'",
139 _target); 139 _target);
140 140
141 // Make sure that the command references an actual workspace 141 // Make sure that the command references an actual workspace
@@ -161,7 +161,7 @@ char *workspace_next_name(const char *output_name) {
161 temp[length - 1] = '\0'; 161 temp[length - 1] = '\0';
162 free(_target); 162 free(_target);
163 _target = temp; 163 _target = temp;
164 wlr_log(L_DEBUG, "Isolated name from workspace number: '%s'", _target); 164 wlr_log(WLR_DEBUG, "Isolated name from workspace number: '%s'", _target);
165 165
166 // Make sure the workspace number doesn't already exist 166 // Make sure the workspace number doesn't already exist
167 if (workspace_by_number(_target)) { 167 if (workspace_by_number(_target)) {
@@ -190,7 +190,7 @@ char *workspace_next_name(const char *output_name) {
190 order = binding->order; 190 order = binding->order;
191 free(target); 191 free(target);
192 target = _target; 192 target = _target;
193 wlr_log(L_DEBUG, "Workspace: Found free name %s", _target); 193 wlr_log(WLR_DEBUG, "Workspace: Found free name %s", _target);
194 } else { 194 } else {
195 free(_target); 195 free(_target);
196 } 196 }
@@ -387,7 +387,7 @@ bool workspace_switch(struct sway_container *workspace) {
387 free(prev_workspace_name); 387 free(prev_workspace_name);
388 prev_workspace_name = malloc(strlen(active_ws->name) + 1); 388 prev_workspace_name = malloc(strlen(active_ws->name) + 1);
389 if (!prev_workspace_name) { 389 if (!prev_workspace_name) {
390 wlr_log(L_ERROR, "Unable to allocate previous workspace name"); 390 wlr_log(WLR_ERROR, "Unable to allocate previous workspace name");
391 return false; 391 return false;
392 } 392 }
393 strcpy(prev_workspace_name, active_ws->name); 393 strcpy(prev_workspace_name, active_ws->name);
@@ -409,7 +409,7 @@ bool workspace_switch(struct sway_container *workspace) {
409 } 409 }
410 } 410 }
411 411
412 wlr_log(L_DEBUG, "Switching to workspace %p:%s", 412 wlr_log(WLR_DEBUG, "Switching to workspace %p:%s",
413 workspace, workspace->name); 413 workspace, workspace->name);
414 struct sway_container *next = seat_get_focus_inactive(seat, workspace); 414 struct sway_container *next = seat_get_focus_inactive(seat, workspace);
415 if (next == NULL) { 415 if (next == NULL) {