[gnome-shell/wip/rstrode/rhel-8.0.0: 22/50] global: Allow overriding the override schema



commit d376b829b4dd4db727fa7c0b9e572136db3fdf71
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Oct 11 00:36:18 2017 +0200

    global: Allow overriding the override schema

 src/main.c         | 11 ++++++++++-
 src/shell-global.c | 20 +++++++++++++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 857877b0b..6ebea4809 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,6 +38,7 @@ extern GType gnome_shell_plugin_get_type (void);
 
 static gboolean is_gdm_mode = FALSE;
 static char *session_mode = NULL;
+static char *override_schema = NULL;
 static int caught_signal = 0;
 
 #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
@@ -450,6 +451,12 @@ GOptionEntry gnome_shell_options[] = {
     N_("List possible modes"),
     NULL
   },
+  {
+    "override-schema", 0, 0, G_OPTION_ARG_STRING,
+    &override_schema,
+    N_("Override the override schema"),
+    "SCHEMA"
+  },
   { NULL }
 };
 
@@ -507,7 +514,9 @@ main (int argc, char **argv)
   if (session_mode == NULL)
     session_mode = is_gdm_mode ? (char *)"gdm" : (char *)"user";
 
-  _shell_global_init ("session-mode", session_mode, NULL);
+  _shell_global_init ("session-mode", session_mode,
+                      "override-schema", override_schema,
+                      NULL);
 
   shell_prefs_init ();
 
diff --git a/src/shell-global.c b/src/shell-global.c
index c67ac4e4a..961fd3a70 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -65,6 +65,7 @@ struct _ShellGlobal {
   MetaScreen *meta_screen;
 
   char *session_mode;
+  char *override_schema;
 
   XserverRegion input_region;
 
@@ -96,6 +97,7 @@ enum {
   PROP_0,
 
   PROP_SESSION_MODE,
+  PROP_OVERRIDE_SCHEMA,
   PROP_SCREEN,
   PROP_DISPLAY,
   PROP_SCREEN_WIDTH,
@@ -138,6 +140,10 @@ shell_global_set_property(GObject         *object,
       g_clear_pointer (&global->session_mode, g_free);
       global->session_mode = g_ascii_strdown (g_value_get_string (value), -1);
       break;
+    case PROP_OVERRIDE_SCHEMA:
+      g_clear_pointer (&global->override_schema, g_free);
+      global->override_schema = g_value_dup_string (value);
+      break;
     case PROP_FRAME_TIMESTAMPS:
       global->frame_timestamps = g_value_get_boolean (value);
       break;
@@ -163,6 +169,9 @@ shell_global_get_property(GObject         *object,
     case PROP_SESSION_MODE:
       g_value_set_string (value, shell_global_get_session_mode (global));
       break;
+    case PROP_OVERRIDE_SCHEMA:
+      g_value_set_string (value, global->override_schema);
+      break;
     case PROP_SCREEN:
       g_value_set_object (value, global->meta_screen);
       break;
@@ -368,6 +377,13 @@ shell_global_class_init (ShellGlobalClass *klass)
                                    g_param_spec_string ("session-mode",
                                                         "Session Mode",
                                                         "The session mode to use",
+                                                        NULL,
+                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+  g_object_class_install_property (gobject_class,
+                                   PROP_OVERRIDE_SCHEMA,
+                                   g_param_spec_string ("override-schema",
+                                                        "Override Schema",
+                                                        "The override schema to use",
                                                         "user",
                                                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (gobject_class,
@@ -1360,7 +1376,9 @@ shell_global_get_overrides_settings (ShellGlobal *global)
 
   if (!settings)
     {
-      if (strcmp (global->session_mode, "classic") == 0)
+      if (global->override_schema != NULL)
+        schema = global->override_schema;
+      else if (strcmp (global->session_mode, "classic") == 0)
         schema = "org.gnome.shell.extensions.classic-overrides";
       else if (strcmp (global->session_mode, "user") == 0)
         schema = "org.gnome.shell.overrides";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]