diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-02-21 09:14:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-21 09:14:19 -0500 |
commit | 79c133182d85342748b284e20e1e634821ce419c (patch) | |
tree | 690007114db3d7e4bfcfeb0c1637d06c82993c08 | |
parent | output_evacuate: call workspace_consider_destroy (diff) | |
parent | output_get_active_workspace: check workspaces length (diff) | |
download | sway-79c133182d85342748b284e20e1e634821ce419c.tar.gz sway-79c133182d85342748b284e20e1e634821ce419c.tar.zst sway-79c133182d85342748b284e20e1e634821ce419c.zip |
Merge pull request #3743 from RedSoxFan/fix-output-get-active-workspace
output_get_active_workspace: check workspaces length
-rw-r--r-- | sway/desktop/output.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index c5461ee6..61beb7af 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -320,6 +320,9 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) { | |||
320 | struct sway_seat *seat = input_manager_current_seat(); | 320 | struct sway_seat *seat = input_manager_current_seat(); |
321 | struct sway_node *focus = seat_get_active_tiling_child(seat, &output->node); | 321 | struct sway_node *focus = seat_get_active_tiling_child(seat, &output->node); |
322 | if (!focus) { | 322 | if (!focus) { |
323 | if (!output->workspaces->length) { | ||
324 | return NULL; | ||
325 | } | ||
323 | return output->workspaces->items[0]; | 326 | return output->workspaces->items[0]; |
324 | } | 327 | } |
325 | return focus->sway_workspace; | 328 | return focus->sway_workspace; |