summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-12-01 12:22:12 +0100
committerJonas Ã…dahl <jadahl@gmail.com>2022-01-27 18:14:51 +0100
commit447d82de1876a62f7b75e506cb358b252a085466 (patch)
treec083bcfd2c74ec73404f1c4b3679704adc5ccd36
parentdc489b7981d331238c8793233e6b31924b8ce67e (diff)
downloadmutter-447d82de1876a62f7b75e506cb358b252a085466.tar.gz
stack: Add prerequisites to some stack API
Passing a NULL workspace does not make sense, since it silently returns no windows. Mandate that a workspace is explicitly requested, and while at it check the other arguments as well. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2124> (cherry picked from commit fa31c97aec925056ef04162b2c172a7f5e74af68)
-rw-r--r--src/core/stack.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/stack.c b/src/core/stack.c
index 95223e48e..50e9e7e04 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -1091,6 +1091,10 @@ meta_stack_get_default_focus_window_at_point (MetaStack *stack,
int root_x,
int root_y)
{
+ g_return_val_if_fail (META_IS_STACK (stack), NULL);
+ g_return_val_if_fail (META_IS_WORKSPACE (workspace), NULL);
+ g_return_val_if_fail (!not_this_one || META_IS_WINDOW (not_this_one), NULL);
+
return get_default_focus_window (stack, workspace, not_this_one,
TRUE, root_x, root_y);
}
@@ -1100,6 +1104,10 @@ meta_stack_get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one)
{
+ g_return_val_if_fail (META_IS_STACK (stack), NULL);
+ g_return_val_if_fail (META_IS_WORKSPACE (workspace), NULL);
+ g_return_val_if_fail (!not_this_one || META_IS_WINDOW (not_this_one), NULL);
+
return get_default_focus_window (stack, workspace, not_this_one,
FALSE, 0, 0);
}