diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-17 20:16:23 +1000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-22 09:55:13 +0100 |
commit | 2301349ad59751640ed9e59dd22edeafaf09da39 (patch) | |
tree | 1726c2f8ec1cd9baaf27fbed62aa6a337bc85ce7 /sway/tree/view.c | |
parent | seat_create: set initial focus for added seats (diff) | |
download | sway-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.c | 7 |
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 | ||
526 | static bool should_focus(struct sway_view *view) { | 527 | static bool should_focus(struct sway_view *view) { |