From f171f92522ab6189037151533a8b163296f00a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 17 Aug 2022 16:25:31 +0200 Subject: [PATCH] shell-global: Add MetaContext getter Start to use it instead of using g_object_get(). Part-of: --- src/shell-global.c | 13 ++++++++++++- src/shell-global.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/shell-global.c b/src/shell-global.c index 0ccdb1029..baa28e6d6 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -821,6 +821,17 @@ shell_global_set_stage_input_region (ShellGlobal *global, sync_input_region (global); } +/** + * shell_global_get_context: + * + * Return value: (transfer none): The #MetaContext + */ +MetaContext * +shell_global_get_context (ShellGlobal *global) +{ + return global->meta_context; +} + /** * shell_global_get_stage: * @@ -1269,7 +1280,7 @@ shell_global_reexec_self (ShellGlobal *global) */ pre_exec_close_fds (); - g_object_get (global, "context", &meta_context, NULL); + meta_context = shell_global_get_context (global); meta_context_restore_rlimit_nofile (meta_context, NULL); meta_display_close (shell_global_get_display (global), diff --git a/src/shell-global.h b/src/shell-global.h index 8d8238ca2..87f4e590c 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -15,6 +15,7 @@ G_DECLARE_FINAL_TYPE (ShellGlobal, shell_global, SHELL, GLOBAL, GObject) ShellGlobal *shell_global_get (void); +MetaContext *shell_global_get_context (ShellGlobal *global); ClutterStage *shell_global_get_stage (ShellGlobal *global); MetaDisplay *shell_global_get_display (ShellGlobal *global); GList *shell_global_get_window_actors (ShellGlobal *global);