summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2022-11-23 10:26:55 +0100
committerMarge Bot <marge-bot@gnome.org>2022-12-17 13:25:13 +0000
commite709853ad3d043ee2ed72e75fbda0c225e30eda7 (patch)
tree1e94e657eb7f98db9fa77855e7d04e636abe58b0
parent9d9fcc0bb17d7dd00040d883831fd784878b52f7 (diff)
downloadmutter-e709853ad3d043ee2ed72e75fbda0c225e30eda7.tar.gz
workspace: Sanity check input to activate*()
The passed argument should be a workspace, and it should not have been removed. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2707>
-rw-r--r--src/core/workspace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/workspace.c b/src/core/workspace.c
index d82158e95..e933995f3 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -577,6 +577,9 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
gint num_workspaces, current_space, new_space;
MetaMotionDirection direction;
+ g_return_if_fail (META_IS_WORKSPACE (workspace));
+ g_return_if_fail (meta_workspace_index (workspace) != -1);
+
meta_verbose ("Activating workspace %d",
meta_workspace_index (workspace));