diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 56 |
1 files changed, 28 insertions, 28 deletions
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 | ||
128 | void container_add_child(struct sway_container *parent, | 128 | void 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, | |||
896 | void container_recursive_resize(struct sway_container *container, | 896 | void 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; |