summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-04-19 16:13:47 +0200
committerJonas Ådahl <jadahl@gmail.com>2021-07-15 11:34:37 +0200
commitff0afb186a2741691deca02652a4c2f193246e50 (patch)
treea36e2dd4deb6a09b52112508dc109e7c11fa59e3 /src/core
parent50ed027b6f63e6a1b7cc2850c5e68fec1ee4c890 (diff)
downloadmutter-ff0afb186a2741691deca02652a4c2f193246e50.tar.gz
context: Move 'replace-current-wm' tracking to the context
This move yet another scattered global static variable into the context's control. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/meta-context-main.c10
-rw-r--r--src/core/meta-context-private.h2
-rw-r--r--src/core/meta-context.c6
-rw-r--r--src/core/util.c13
4 files changed, 17 insertions, 14 deletions
diff --git a/src/core/meta-context-main.c b/src/core/meta-context-main.c
index 6c40ba526..8f669151a 100644
--- a/src/core/meta-context-main.c
+++ b/src/core/meta-context-main.c
@@ -329,6 +329,14 @@ meta_context_main_get_x11_display_policy (MetaContext *context)
g_assert_not_reached ();
}
+static gboolean
+meta_context_main_is_replacing (MetaContext *context)
+{
+ MetaContextMain *context_main = META_CONTEXT_MAIN (context);
+
+ return context_main->options.x11.replace;
+}
+
#ifdef HAVE_NATIVE_BACKEND
static gboolean
add_persistent_virtual_monitors (MetaContextMain *context_main,
@@ -382,7 +390,6 @@ meta_context_main_setup (MetaContext *context,
return FALSE;
meta_set_syncing (context_main->options.x11.sync || g_getenv ("MUTTER_SYNC"));
- meta_set_replace_current_wm (context_main->options.x11.replace);
#ifdef HAVE_NATIVE_BACKEND
if (!add_persistent_virtual_monitors (context_main, error))
@@ -682,6 +689,7 @@ meta_context_main_class_init (MetaContextMainClass *klass)
context_class->get_compositor_type = meta_context_main_get_compositor_type;
context_class->get_x11_display_policy =
meta_context_main_get_x11_display_policy;
+ context_class->is_replacing = meta_context_main_is_replacing;
context_class->setup = meta_context_main_setup;
context_class->create_backend = meta_context_main_create_backend;
context_class->notify_ready = meta_context_main_notify_ready;
diff --git a/src/core/meta-context-private.h b/src/core/meta-context-private.h
index 422316cb5..503d78ef7 100644
--- a/src/core/meta-context-private.h
+++ b/src/core/meta-context-private.h
@@ -39,6 +39,8 @@ struct _MetaContextClass
MetaX11DisplayPolicy (* get_x11_display_policy) (MetaContext *context);
+ gboolean (* is_replacing) (MetaContext *context);
+
gboolean (* setup) (MetaContext *context,
GError **error);
diff --git a/src/core/meta-context.c b/src/core/meta-context.c
index 79c3ff9d7..291cdbd32 100644
--- a/src/core/meta-context.c
+++ b/src/core/meta-context.c
@@ -212,6 +212,12 @@ meta_context_get_compositor_type (MetaContext *context)
return META_CONTEXT_GET_CLASS (context)->get_compositor_type (context);
}
+gboolean
+meta_context_is_replacing (MetaContext *context)
+{
+ return META_CONTEXT_GET_CLASS (context)->is_replacing (context);
+}
+
MetaX11DisplayPolicy
meta_context_get_x11_display_policy (MetaContext *context)
{
diff --git a/src/core/util.c b/src/core/util.c
index 28e794781..da3dfa5f4 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -80,7 +80,6 @@ meta_topic_real_valist (MetaDebugTopic topic,
#endif
static gint verbose_topics = 0;
-static gboolean replace_current = FALSE;
static int no_prefix = 0;
static gboolean is_wayland_compositor = FALSE;
static int debug_paint_flags = 0;
@@ -219,18 +218,6 @@ meta_init_debug_utils (void)
}
gboolean
-meta_get_replace_current_wm (void)
-{
- return replace_current;
-}
-
-void
-meta_set_replace_current_wm (gboolean setting)
-{
- replace_current = setting;
-}
-
-gboolean
meta_is_wayland_compositor (void)
{
return is_wayland_compositor;