diff options
author | Ryan Dwyer <[email protected]> | 2019-01-17 20:16:23 +1000 |
---|---|---|
committer | emersion <[email protected]> | 2019-01-22 09:55:13 +0100 |
commit | 2301349ad59751640ed9e59dd22edeafaf09da39 (patch) | |
tree | 1726c2f8ec1cd9baaf27fbed62aa6a337bc85ce7 /sway/tree/view.c | |
parent | ab0248a54564b2f644b6fb367f9eb44fe0bf5f3c (diff) |
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) { 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]; + // When there's no outputs connected, the above should match a workspace on + // the noop output. + sway_assert(false, "Expected to find a workspace"); + return NULL; } static bool should_focus(struct sway_view *view) { |