diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 16:09:27 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 16:09:27 -0400 |
commit | d434da563239c43c5fe417ce83b23b417f2ab635 (patch) | |
tree | e154daaf43c42d11c5afb8b7739ae6b52dd01215 /sway/tree/layout.c | |
parent | fix workspace splits (diff) | |
parent | Merge pull request #1699 from acrisci/seat-fixes (diff) | |
download | sway-d434da563239c43c5fe417ce83b23b417f2ab635.tar.gz sway-d434da563239c43c5fe417ce83b23b417f2ab635.tar.zst sway-d434da563239c43c5fe417ce83b23b417f2ab635.zip |
Merge branch 'wlroots' into split-containers
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index bea15f8a..88463e3b 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -158,17 +158,17 @@ void container_move_to(struct sway_container *container, | |||
158 | } | 158 | } |
159 | wl_signal_emit(&container->events.reparent, old_parent); | 159 | wl_signal_emit(&container->events.reparent, old_parent); |
160 | if (container->type == C_WORKSPACE) { | 160 | if (container->type == C_WORKSPACE) { |
161 | struct sway_seat *seat = sway_input_manager_get_default_seat( | 161 | struct sway_seat *seat = input_manager_get_default_seat( |
162 | input_manager); | 162 | input_manager); |
163 | if (old_parent->children->length == 0) { | 163 | if (old_parent->children->length == 0) { |
164 | char *ws_name = workspace_next_name(old_parent->name); | 164 | char *ws_name = workspace_next_name(old_parent->name); |
165 | struct sway_container *ws = | 165 | struct sway_container *ws = |
166 | container_workspace_create(old_parent, ws_name); | 166 | container_workspace_create(old_parent, ws_name); |
167 | free(ws_name); | 167 | free(ws_name); |
168 | sway_seat_set_focus(seat, ws); | 168 | seat_set_focus(seat, ws); |
169 | } | 169 | } |
170 | container_sort_workspaces(new_parent); | 170 | container_sort_workspaces(new_parent); |
171 | sway_seat_set_focus(seat, new_parent); | 171 | seat_set_focus(seat, new_parent); |
172 | } | 172 | } |
173 | if (old_parent) { | 173 | if (old_parent) { |
174 | arrange_windows(old_parent, -1, -1); | 174 | arrange_windows(old_parent, -1, -1); |
@@ -275,8 +275,8 @@ void arrange_windows(struct sway_container *container, | |||
275 | struct wlr_box *area = &output->sway_output->usable_area; | 275 | struct wlr_box *area = &output->sway_output->usable_area; |
276 | wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 276 | wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", |
277 | area->width, area->height, area->x, area->y); | 277 | area->width, area->height, area->x, area->y); |
278 | container->width = area->width; | 278 | container->width = width = area->width; |
279 | container->height = area->height; | 279 | container->height = height = area->height; |
280 | container->x = x = area->x; | 280 | container->x = x = area->x; |
281 | container->y = y = area->y; | 281 | container->y = y = area->y; |
282 | wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", | 282 | wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", |
@@ -441,7 +441,7 @@ static struct sway_container *get_swayc_in_output_direction( | |||
441 | return NULL; | 441 | return NULL; |
442 | } | 442 | } |
443 | 443 | ||
444 | struct sway_container *ws = sway_seat_get_focus_inactive(seat, output); | 444 | struct sway_container *ws = seat_get_focus_inactive(seat, output); |
445 | if (ws->type != C_WORKSPACE) { | 445 | if (ws->type != C_WORKSPACE) { |
446 | ws = container_parent(ws, C_WORKSPACE); | 446 | ws = container_parent(ws, C_WORKSPACE); |
447 | } | 447 | } |
@@ -462,7 +462,7 @@ static struct sway_container *get_swayc_in_output_direction( | |||
462 | case MOVE_UP: | 462 | case MOVE_UP: |
463 | case MOVE_DOWN: { | 463 | case MOVE_DOWN: { |
464 | struct sway_container *focused = | 464 | struct sway_container *focused = |
465 | sway_seat_get_focus_inactive(seat, ws); | 465 | seat_get_focus_inactive(seat, ws); |
466 | if (focused && focused->parent) { | 466 | if (focused && focused->parent) { |
467 | struct sway_container *parent = focused->parent; | 467 | struct sway_container *parent = focused->parent; |
468 | if (parent->layout == L_VERT) { | 468 | if (parent->layout == L_VERT) { |
@@ -546,7 +546,7 @@ struct sway_container *container_get_in_direction( | |||
546 | struct sway_container *container, struct sway_seat *seat, | 546 | struct sway_container *container, struct sway_seat *seat, |
547 | enum movement_direction dir) { | 547 | enum movement_direction dir) { |
548 | if (dir == MOVE_CHILD) { | 548 | if (dir == MOVE_CHILD) { |
549 | return sway_seat_get_focus_inactive(seat, container); | 549 | return seat_get_focus_inactive(seat, container); |
550 | } | 550 | } |
551 | 551 | ||
552 | struct sway_container *parent = container->parent; | 552 | struct sway_container *parent = container->parent; |
@@ -605,7 +605,7 @@ struct sway_container *container_get_in_direction( | |||
605 | } | 605 | } |
606 | if (next->children && next->children->length) { | 606 | if (next->children && next->children->length) { |
607 | // TODO consider floating children as well | 607 | // TODO consider floating children as well |
608 | return sway_seat_get_focus_by_type(seat, next, C_VIEW); | 608 | return seat_get_focus_by_type(seat, next, C_VIEW); |
609 | } else { | 609 | } else { |
610 | return next; | 610 | return next; |
611 | } | 611 | } |
@@ -635,7 +635,7 @@ struct sway_container *container_get_in_direction( | |||
635 | wrap_candidate = parent->children->items[0]; | 635 | wrap_candidate = parent->children->items[0]; |
636 | } | 636 | } |
637 | if (config->force_focus_wrapping) { | 637 | if (config->force_focus_wrapping) { |
638 | return sway_seat_get_focus_by_type(seat, | 638 | return seat_get_focus_by_type(seat, |
639 | wrap_candidate, C_VIEW); | 639 | wrap_candidate, C_VIEW); |
640 | } | 640 | } |
641 | } | 641 | } |
@@ -643,7 +643,7 @@ struct sway_container *container_get_in_direction( | |||
643 | wlr_log(L_DEBUG, | 643 | wlr_log(L_DEBUG, |
644 | "cont %d-%p dir %i sibling %d: %p", idx, | 644 | "cont %d-%p dir %i sibling %d: %p", idx, |
645 | container, dir, desired, parent->children->items[desired]); | 645 | container, dir, desired, parent->children->items[desired]); |
646 | return sway_seat_get_focus_by_type(seat, | 646 | return seat_get_focus_by_type(seat, |
647 | parent->children->items[desired], C_VIEW); | 647 | parent->children->items[desired], C_VIEW); |
648 | } | 648 | } |
649 | } | 649 | } |
@@ -702,9 +702,9 @@ struct sway_container *container_split(struct sway_container *child, | |||
702 | cont->y = child->y; | 702 | cont->y = child->y; |
703 | 703 | ||
704 | if (child->type == C_WORKSPACE) { | 704 | if (child->type == C_WORKSPACE) { |
705 | struct sway_seat *seat = sway_input_manager_get_default_seat(input_manager); | 705 | struct sway_seat *seat = input_manager_get_default_seat(input_manager); |
706 | struct sway_container *workspace = child; | 706 | struct sway_container *workspace = child; |
707 | bool set_focus = (sway_seat_get_focus(seat) == workspace); | 707 | bool set_focus = (seat_get_focus(seat) == workspace); |
708 | 708 | ||
709 | while (workspace->children->length) { | 709 | while (workspace->children->length) { |
710 | struct sway_container *ws_child = workspace->children->items[0]; | 710 | struct sway_container *ws_child = workspace->children->items[0]; |
@@ -716,7 +716,7 @@ struct sway_container *container_split(struct sway_container *child, | |||
716 | container_set_layout(workspace, layout); | 716 | container_set_layout(workspace, layout); |
717 | 717 | ||
718 | if (set_focus) { | 718 | if (set_focus) { |
719 | sway_seat_set_focus(seat, cont); | 719 | seat_set_focus(seat, cont); |
720 | } | 720 | } |
721 | } else { | 721 | } else { |
722 | cont->layout = layout; | 722 | cont->layout = layout; |