Skip to content
Snippets Groups Projects
Commit 9f4e6a8c authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

Merge branch 'unlocked' into 'master'

Allow to spawn phosh unlocked

See merge request !63
parents b89282e7 36153714
No related branches found
No related tags found
1 merge request!63Allow to spawn phosh unlocked
......@@ -745,8 +745,6 @@ phosh_shell_constructed (GObject *object)
PhoshShellPrivate *priv = phosh_shell_get_instance_private (self);
guint num_mon;;
_phosh = self; /* set singleton */
G_OBJECT_CLASS (phosh_shell_parent_class)->constructed (object);
gdk_set_allowed_backends ("wayland");
......@@ -794,7 +792,6 @@ phosh_shell_constructed (GObject *object)
background_create (self);
#endif
lockscreen_prepare (self);
phosh_shell_lock (self);
}
......@@ -924,6 +921,20 @@ int main(int argc, char *argv[])
{
g_autoptr(GSource) sigterm;
GMainContext *context;
GOptionContext *opt_context;
GError *err = NULL;
gboolean unlocked;
const GOptionEntry options [] = {
{"unlocked", 'U', 0, G_OPTION_ARG_NONE, &unlocked,
"Don't start with screen locked", NULL},
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
opt_context = g_option_context_new ("- A phone graphical shell");
g_option_context_add_main_entries (opt_context, options, NULL);
g_option_context_add_group (opt_context, gtk_get_option_group (TRUE));
g_option_context_parse (opt_context, &argc, &argv, &err);
textdomain (GETTEXT_PACKAGE);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......@@ -935,7 +946,10 @@ int main(int argc, char *argv[])
g_source_set_callback (sigterm, sigterm_cb, NULL, NULL);
g_source_attach (sigterm, context);
g_object_new (PHOSH_TYPE_SHELL, NULL);
_phosh = g_object_new (PHOSH_TYPE_SHELL, NULL);
if (!unlocked)
phosh_shell_lock (_phosh);
gtk_main ();
g_object_unref (_phosh);
_phosh = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment