global: Allow overriding the override schema
This commit is contained in:
parent
e11404d1cf
commit
d376b829b4
11
src/main.c
11
src/main.c
@ -38,6 +38,7 @@ extern GType gnome_shell_plugin_get_type (void);
|
|||||||
|
|
||||||
static gboolean is_gdm_mode = FALSE;
|
static gboolean is_gdm_mode = FALSE;
|
||||||
static char *session_mode = NULL;
|
static char *session_mode = NULL;
|
||||||
|
static char *override_schema = NULL;
|
||||||
static int caught_signal = 0;
|
static int caught_signal = 0;
|
||||||
|
|
||||||
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
|
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1
|
||||||
@ -450,6 +451,12 @@ GOptionEntry gnome_shell_options[] = {
|
|||||||
N_("List possible modes"),
|
N_("List possible modes"),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"override-schema", 0, 0, G_OPTION_ARG_STRING,
|
||||||
|
&override_schema,
|
||||||
|
N_("Override the override schema"),
|
||||||
|
"SCHEMA"
|
||||||
|
},
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -507,7 +514,9 @@ main (int argc, char **argv)
|
|||||||
if (session_mode == NULL)
|
if (session_mode == NULL)
|
||||||
session_mode = is_gdm_mode ? (char *)"gdm" : (char *)"user";
|
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 ();
|
shell_prefs_init ();
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ struct _ShellGlobal {
|
|||||||
MetaScreen *meta_screen;
|
MetaScreen *meta_screen;
|
||||||
|
|
||||||
char *session_mode;
|
char *session_mode;
|
||||||
|
char *override_schema;
|
||||||
|
|
||||||
XserverRegion input_region;
|
XserverRegion input_region;
|
||||||
|
|
||||||
@ -96,6 +97,7 @@ enum {
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
||||||
PROP_SESSION_MODE,
|
PROP_SESSION_MODE,
|
||||||
|
PROP_OVERRIDE_SCHEMA,
|
||||||
PROP_SCREEN,
|
PROP_SCREEN,
|
||||||
PROP_DISPLAY,
|
PROP_DISPLAY,
|
||||||
PROP_SCREEN_WIDTH,
|
PROP_SCREEN_WIDTH,
|
||||||
@ -138,6 +140,10 @@ shell_global_set_property(GObject *object,
|
|||||||
g_clear_pointer (&global->session_mode, g_free);
|
g_clear_pointer (&global->session_mode, g_free);
|
||||||
global->session_mode = g_ascii_strdown (g_value_get_string (value), -1);
|
global->session_mode = g_ascii_strdown (g_value_get_string (value), -1);
|
||||||
break;
|
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:
|
case PROP_FRAME_TIMESTAMPS:
|
||||||
global->frame_timestamps = g_value_get_boolean (value);
|
global->frame_timestamps = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@ -163,6 +169,9 @@ shell_global_get_property(GObject *object,
|
|||||||
case PROP_SESSION_MODE:
|
case PROP_SESSION_MODE:
|
||||||
g_value_set_string (value, shell_global_get_session_mode (global));
|
g_value_set_string (value, shell_global_get_session_mode (global));
|
||||||
break;
|
break;
|
||||||
|
case PROP_OVERRIDE_SCHEMA:
|
||||||
|
g_value_set_string (value, global->override_schema);
|
||||||
|
break;
|
||||||
case PROP_SCREEN:
|
case PROP_SCREEN:
|
||||||
g_value_set_object (value, global->meta_screen);
|
g_value_set_object (value, global->meta_screen);
|
||||||
break;
|
break;
|
||||||
@ -368,6 +377,13 @@ shell_global_class_init (ShellGlobalClass *klass)
|
|||||||
g_param_spec_string ("session-mode",
|
g_param_spec_string ("session-mode",
|
||||||
"Session Mode",
|
"Session Mode",
|
||||||
"The session mode to use",
|
"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",
|
"user",
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
@ -1360,7 +1376,9 @@ shell_global_get_overrides_settings (ShellGlobal *global)
|
|||||||
|
|
||||||
if (!settings)
|
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";
|
schema = "org.gnome.shell.extensions.classic-overrides";
|
||||||
else if (strcmp (global->session_mode, "user") == 0)
|
else if (strcmp (global->session_mode, "user") == 0)
|
||||||
schema = "org.gnome.shell.overrides";
|
schema = "org.gnome.shell.overrides";
|
||||||
|
Loading…
Reference in New Issue
Block a user