From 0b97bbf9f6311e88f422925c19292461b1fb3b94 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 16 Nov 2021 22:39:00 +0300 Subject: [PATCH] Add cotinue --- sway/server.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sway/server.c b/sway/server.c index 3ac318fbe..28d680f87 100644 --- a/sway/server.c +++ b/sway/server.c @@ -59,12 +59,16 @@ static void handle_workspace_manager_commit_request(struct wl_listener *listener struct wlr_workspace_group_handle_v1 *group; wl_list_for_each(group, &manager->groups, link) { struct wlr_workspace_handle_v1 *workspace; - struct wlr_workspace_handle_v1 *next_active_workspace; + struct wlr_workspace_handle_v1 *next_active_workspace = NULL; wl_list_for_each(workspace, &group->workspaces, link) { if (workspace->current & WLR_WORKSPACE_HANDLE_V1_STATE_ACTIVE) { next_active_workspace = workspace; } } + if (!next_active_workspace) { + continue; + } + struct sway_workspace *sw_workspace = workspace_by_name(next_active_workspace->name); workspace_switch(sw_workspace, false); }