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 | |
parent | d070244362f7d34bc15418154e52f8c968fbad41 (diff) | |
parent | 0c0cc79282b5ce29616893977aca629f90521988 (diff) |
Merge branch 'wlroots' into split-containers
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 4 | ||||
-rw-r--r-- | sway/tree/layout.c | 28 | ||||
-rw-r--r-- | sway/tree/workspace.c | 14 |
3 files changed, 23 insertions, 23 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 9205d929..4db93ce8 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -89,8 +89,8 @@ static struct sway_container *_container_destroy(struct sway_container *cont) { // container_remove_child, which removes child from this container while (cont->children != NULL && cont->children->length != 0) { struct sway_container *child = cont->children->items[0]; + container_remove_child(child); container_destroy(child); - list_del(cont->children, 0); } } if (cont->marks) { @@ -172,7 +172,7 @@ struct sway_container *container_output_create( struct sway_seat *seat = NULL; wl_list_for_each(seat, &input_manager->seats, link) { if (!seat->has_focus) { - sway_seat_set_focus(seat, ws); + seat_set_focus(seat, ws); } } 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, } wl_signal_emit(&container->events.reparent, old_parent); if (container->type == C_WORKSPACE) { - struct sway_seat *seat = sway_input_manager_get_default_seat( + struct sway_seat *seat = input_manager_get_default_seat( input_manager); if (old_parent->children->length == 0) { char *ws_name = workspace_next_name(old_parent->name); struct sway_container *ws = container_workspace_create(old_parent, ws_name); free(ws_name); - sway_seat_set_focus(seat, ws); + seat_set_focus(seat, ws); } container_sort_workspaces(new_parent); - sway_seat_set_focus(seat, new_parent); + seat_set_focus(seat, new_parent); } if (old_parent) { arrange_windows(old_parent, -1, -1); @@ -275,8 +275,8 @@ void arrange_windows(struct sway_container *container, struct wlr_box *area = &output->sway_output->usable_area; wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", area->width, area->height, area->x, area->y); - container->width = area->width; - container->height = area->height; + container->width = width = area->width; + container->height = height = area->height; container->x = x = area->x; container->y = y = area->y; wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", @@ -441,7 +441,7 @@ static struct sway_container *get_swayc_in_output_direction( return NULL; } - struct sway_container *ws = sway_seat_get_focus_inactive(seat, output); + struct sway_container *ws = seat_get_focus_inactive(seat, output); if (ws->type != C_WORKSPACE) { ws = container_parent(ws, C_WORKSPACE); } @@ -462,7 +462,7 @@ static struct sway_container *get_swayc_in_output_direction( case MOVE_UP: case MOVE_DOWN: { struct sway_container *focused = - sway_seat_get_focus_inactive(seat, ws); + seat_get_focus_inactive(seat, ws); if (focused && focused->parent) { struct sway_container *parent = focused->parent; if (parent->layout == L_VERT) { @@ -546,7 +546,7 @@ struct sway_container *container_get_in_direction( struct sway_container *container, struct sway_seat *seat, enum movement_direction dir) { if (dir == MOVE_CHILD) { - return sway_seat_get_focus_inactive(seat, container); + return seat_get_focus_inactive(seat, container); } struct sway_container *parent = container->parent; @@ -605,7 +605,7 @@ struct sway_container *container_get_in_direction( } if (next->children && next->children->length) { // TODO consider floating children as well - return sway_seat_get_focus_by_type(seat, next, C_VIEW); + return seat_get_focus_by_type(seat, next, C_VIEW); } else { return next; } @@ -635,7 +635,7 @@ struct sway_container *container_get_in_direction( wrap_candidate = parent->children->items[0]; } if (config->force_focus_wrapping) { - return sway_seat_get_focus_by_type(seat, + return seat_get_focus_by_type(seat, wrap_candidate, C_VIEW); } } @@ -643,7 +643,7 @@ struct sway_container *container_get_in_direction( wlr_log(L_DEBUG, "cont %d-%p dir %i sibling %d: %p", idx, container, dir, desired, parent->children->items[desired]); - return sway_seat_get_focus_by_type(seat, + return seat_get_focus_by_type(seat, parent->children->items[desired], C_VIEW); } } @@ -702,9 +702,9 @@ struct sway_container *container_split(struct sway_container *child, cont->y = child->y; if (child->type == C_WORKSPACE) { - struct sway_seat *seat = sway_input_manager_get_default_seat(input_manager); + struct sway_seat *seat = input_manager_get_default_seat(input_manager); struct sway_container *workspace = child; - bool set_focus = (sway_seat_get_focus(seat) == workspace); + bool set_focus = (seat_get_focus(seat) == workspace); while (workspace->children->length) { struct sway_container *ws_child = workspace->children->items[0]; @@ -716,7 +716,7 @@ struct sway_container *container_split(struct sway_container *child, container_set_layout(workspace, layout); if (set_focus) { - sway_seat_set_focus(seat, cont); + seat_set_focus(seat, cont); } } else { cont->layout = layout; diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index de1bf159..74330884 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -158,7 +158,7 @@ static bool _workspace_by_name(struct sway_container *view, void *data) { struct sway_container *workspace_by_name(const char *name) { struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_container *current_workspace = NULL, *current_output = NULL; - struct sway_container *focus = sway_seat_get_focus(seat); + struct sway_container *focus = seat_get_focus(seat); if (focus) { current_workspace = container_parent(focus, C_WORKSPACE); current_output = container_parent(focus, C_OUTPUT); @@ -200,7 +200,7 @@ struct sway_container *workspace_create(const char *name) { // Otherwise create a new one struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_container *focus = - sway_seat_get_focus_inactive(seat, &root_container); + seat_get_focus_inactive(seat, &root_container); parent = focus; parent = container_parent(parent, C_OUTPUT); struct sway_container *new_ws = container_workspace_create(parent, name); @@ -260,7 +260,7 @@ struct sway_container *workspace_output_prev_next_impl( } struct sway_seat *seat = input_manager_current_seat(input_manager); - struct sway_container *focus = sway_seat_get_focus_inactive(seat, output); + struct sway_container *focus = seat_get_focus_inactive(seat, output); struct sway_container *workspace = (focus->type == C_WORKSPACE ? focus : container_parent(focus, C_WORKSPACE)); @@ -345,7 +345,7 @@ bool workspace_switch(struct sway_container *workspace) { } struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_container *focus = - sway_seat_get_focus_inactive(seat, &root_container); + seat_get_focus_inactive(seat, &root_container); if (!seat || !focus) { return false; } @@ -376,11 +376,11 @@ bool workspace_switch(struct sway_container *workspace) { wlr_log(L_DEBUG, "Switching to workspace %p:%s", workspace, workspace->name); - struct sway_container *next = sway_seat_get_focus_inactive(seat, workspace); + struct sway_container *next = seat_get_focus_inactive(seat, workspace); if (next == NULL) { next = workspace; } - sway_seat_set_focus(seat, next); + seat_set_focus(seat, next); struct sway_container *output = container_parent(workspace, C_OUTPUT); arrange_windows(output, -1, -1); return true; @@ -389,7 +389,7 @@ bool workspace_switch(struct sway_container *workspace) { bool workspace_is_visible(struct sway_container *ws) { struct sway_container *output = container_parent(ws, C_OUTPUT); struct sway_seat *seat = input_manager_current_seat(input_manager); - struct sway_container *focus = sway_seat_get_focus_inactive(seat, output); + struct sway_container *focus = seat_get_focus_inactive(seat, output); if (focus->type != C_WORKSPACE) { focus = container_parent(focus, C_WORKSPACE); } |