diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/arrange.c | 4 | ||||
-rw-r--r-- | sway/tree/container.c | 4 | ||||
-rw-r--r-- | sway/tree/view.c | 11 | ||||
-rw-r--r-- | sway/tree/workspace.c | 7 |
4 files changed, 18 insertions, 8 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 373460a2..852d53bf 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c @@ -180,6 +180,10 @@ void arrange_workspace(struct sway_workspace *workspace) { if (config->reloading) { return; } + if (!workspace->output) { + // Happens when there are no outputs connected + return; + } struct sway_output *output = workspace->output; struct wlr_box *area = &output->usable_area; wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", diff --git a/sway/tree/container.c b/sway/tree/container.c index f36fe4b0..edab7a17 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1202,8 +1202,8 @@ struct sway_container *container_split(struct sway_container *child, container_add_child(cont, child); if (set_focus) { - seat_set_focus_container(seat, cont); - seat_set_focus_container(seat, child); + seat_set_raw_focus(seat, &cont->node); + seat_set_raw_focus(seat, &child->node); } return cont; diff --git a/sway/tree/view.c b/sway/tree/view.c index 4b9bbfd0..85998547 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -504,7 +504,16 @@ static struct sway_workspace *select_workspace(struct sway_view *view) { } // Use the focused workspace - return seat_get_focused_workspace(seat); + struct sway_node *node = seat_get_focus_inactive(seat, &root->node); + if (node && node->type == N_WORKSPACE) { + return node->sway_workspace; + } else if (node && node->type == N_CONTAINER) { + return node->sway_container->workspace; + } + + // If there's no focus_inactive workspace then we must be running without + // any outputs connected + return root->saved_workspaces->items[0]; } static bool should_focus(struct sway_view *view) { diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index d7650560..a1282c1e 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -73,10 +73,10 @@ struct sway_workspace *workspace_create(struct sway_output *output, if (name) { struct workspace_config *wsc = workspace_find_config(name); if (wsc) { - if (wsc->gaps_outer != -1) { + if (wsc->gaps_outer != INT_MIN) { ws->gaps_outer = wsc->gaps_outer; } - if (wsc->gaps_inner != -1) { + if (wsc->gaps_inner != INT_MIN) { ws->gaps_inner = wsc->gaps_inner; } } @@ -618,9 +618,6 @@ void workspace_add_gaps(struct sway_workspace *ws) { if (ws->current_gaps > 0) { return; } - if (!config->edge_gaps) { - return; - } if (config->smart_gaps) { struct sway_seat *seat = input_manager_get_default_seat(input_manager); struct sway_container *focus = |