diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-10-13 18:08:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-13 18:08:23 -0400 |
commit | 02aeb0f0bec90f87acbdbce41d34109b26e9dc5d (patch) | |
tree | 874a3157f2778518a87009c35b47de9d5451b257 | |
parent | fix_edge_gaps: Allow negative values for outer gaps. (diff) | |
parent | Merge pull request #2828 from RyanDwyer/fix-locked-map-crash (diff) | |
download | sway-02aeb0f0bec90f87acbdbce41d34109b26e9dc5d.tar.gz sway-02aeb0f0bec90f87acbdbce41d34109b26e9dc5d.tar.zst sway-02aeb0f0bec90f87acbdbce41d34109b26e9dc5d.zip |
Merge branch 'master' into fix_edge_gaps
-rw-r--r-- | sway/tree/arrange.c | 4 | ||||
-rw-r--r-- | sway/tree/view.c | 11 |
2 files changed, 14 insertions, 1 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) { | |||
180 | if (config->reloading) { | 180 | if (config->reloading) { |
181 | return; | 181 | return; |
182 | } | 182 | } |
183 | if (!workspace->output) { | ||
184 | // Happens when there are no outputs connected | ||
185 | return; | ||
186 | } | ||
183 | struct sway_output *output = workspace->output; | 187 | struct sway_output *output = workspace->output; |
184 | struct wlr_box *area = &output->usable_area; | 188 | struct wlr_box *area = &output->usable_area; |
185 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 189 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", |
diff --git a/sway/tree/view.c b/sway/tree/view.c index e613ac0b..1104af36 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) { | |||
504 | } | 504 | } |
505 | 505 | ||
506 | // Use the focused workspace | 506 | // Use the focused workspace |
507 | return seat_get_focused_workspace(seat); | 507 | struct sway_node *node = seat_get_focus_inactive(seat, &root->node); |
508 | if (node && node->type == N_WORKSPACE) { | ||
509 | return node->sway_workspace; | ||
510 | } else if (node && node->type == N_CONTAINER) { | ||
511 | return node->sway_container->workspace; | ||
512 | } | ||
513 | |||
514 | // If there's no focus_inactive workspace then we must be running without | ||
515 | // any outputs connected | ||
516 | return root->saved_workspaces->items[0]; | ||
508 | } | 517 | } |
509 | 518 | ||
510 | static bool should_focus(struct sway_view *view) { | 519 | static bool should_focus(struct sway_view *view) { |