aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2019-01-17 20:16:23 +1000
committerLibravatar emersion <contact@emersion.fr>2019-01-22 09:55:13 +0100
commit2301349ad59751640ed9e59dd22edeafaf09da39 (patch)
tree1726c2f8ec1cd9baaf27fbed62aa6a337bc85ce7 /sway/tree/view.c
parentseat_create: set initial focus for added seats (diff)
downloadsway-2301349ad59751640ed9e59dd22edeafaf09da39.tar.gz
sway-2301349ad59751640ed9e59dd22edeafaf09da39.tar.zst
sway-2301349ad59751640ed9e59dd22edeafaf09da39.zip
Use noop output when there's no outputs connected
Instead of having NULL workspace->output pointers, use a noop output. This should be safer.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index bc252521..edbfca97 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -518,9 +518,10 @@ static struct sway_workspace *select_workspace(struct sway_view *view) {
518 return node->sway_container->workspace; 518 return node->sway_container->workspace;
519 } 519 }
520 520
521 // If there's no focus_inactive workspace then we must be running without 521 // When there's no outputs connected, the above should match a workspace on
522 // any outputs connected 522 // the noop output.
523 return root->saved_workspaces->items[0]; 523 sway_assert(false, "Expected to find a workspace");
524 return NULL;
524} 525}
525 526
526static bool should_focus(struct sway_view *view) { 527static bool should_focus(struct sway_view *view) {