mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-27 21:58:16 +01:00
Merge pull request #3743 from RedSoxFan/fix-output-get-active-workspace
output_get_active_workspace: check workspaces length
This commit is contained in:
commit
79c133182d
1 changed files with 3 additions and 0 deletions
|
@ -320,6 +320,9 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) {
|
|||
struct sway_seat *seat = input_manager_current_seat();
|
||||
struct sway_node *focus = seat_get_active_tiling_child(seat, &output->node);
|
||||
if (!focus) {
|
||||
if (!output->workspaces->length) {
|
||||
return NULL;
|
||||
}
|
||||
return output->workspaces->items[0];
|
||||
}
|
||||
return focus->sway_workspace;
|
||||
|
|
Loading…
Reference in a new issue