main: Make sure that --mode parameter is valid
Instead of falling back to a set of default values or crashing the window manager when an invalid mode is specified, check the value of the ShellGlobal:session-mode property before taking over as WM and make a clean exit if it cannot be resolved to an existent mode. https://bugzilla.gnome.org/show_bug.cgi?id=676156
This commit is contained in:
@ -335,6 +335,12 @@ main (int argc, char **argv)
|
||||
|
||||
_shell_global_init ("session-mode", session_mode, NULL);
|
||||
|
||||
if (!_shell_global_has_valid_session_mode (shell_global_get ()))
|
||||
{
|
||||
g_printerr ("\"%s\" is not a valid mode.\n", session_mode);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ecode = meta_run ();
|
||||
|
||||
if (g_getenv ("GNOME_SHELL_ENABLE_CLEANUP"))
|
||||
|
Reference in New Issue
Block a user