[gdm/wip/wayland-at-login-screen: 65/70] display: add new is-for-greeter property
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/wip/wayland-at-login-screen: 65/70] display: add new is-for-greeter property
- Date: Wed, 18 Feb 2015 06:28:57 +0000 (UTC)
commit 9c6d843b25936875b3548cb450389c70b498c04e
Author: Ray Strode <rstrode redhat com>
Date: Tue Feb 17 16:46:29 2015 -0500
display: add new is-for-greeter property
This helps us decide whether or not to add a
launch environment to the display.
We need this because some displays go straight
to a user session.
daemon/gdm-display.c | 31 ++++++++++++++++++++++++++++++-
daemon/gdm-local-display.c | 7 +++++++
daemon/gdm-manager.c | 2 ++
3 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 0fca63e..6b2a95a 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -89,6 +89,7 @@ struct GdmDisplayPrivate
guint is_local : 1;
guint is_initial : 1;
+ guint is_for_greeter : 1;
guint allow_timed_login : 1;
guint have_existing_user_accounts : 1;
guint doing_initial_setup : 1;
@@ -108,6 +109,7 @@ enum {
PROP_IS_LOCAL,
PROP_LAUNCH_ENVIRONMENT,
PROP_IS_INITIAL,
+ PROP_IS_FOR_GREETER,
PROP_ALLOW_TIMED_LOGIN,
PROP_HAVE_EXISTING_USER_ACCOUNTS,
PROP_DOING_INITIAL_SETUP,
@@ -713,7 +715,10 @@ gdm_display_manage (GdmDisplay *self)
}
g_timer_start (self->priv->server_timer);
- look_for_existing_users_and_manage (self);
+
+ if (self->priv->is_for_greeter) {
+ look_for_existing_users_and_manage (self);
+ }
return TRUE;
}
@@ -885,6 +890,13 @@ _gdm_display_set_is_initial (GdmDisplay *self,
}
static void
+_gdm_display_set_is_for_greeter (GdmDisplay *self,
+ gboolean for_greeter)
+{
+ self->priv->is_for_greeter = for_greeter;
+}
+
+static void
_gdm_display_set_allow_timed_login (GdmDisplay *self,
gboolean allow_timed_login)
{
@@ -938,6 +950,9 @@ gdm_display_set_property (GObject *object,
case PROP_IS_INITIAL:
_gdm_display_set_is_initial (self, g_value_get_boolean (value));
break;
+ case PROP_IS_FOR_GREETER:
+ _gdm_display_set_is_for_greeter (self, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -992,6 +1007,9 @@ gdm_display_get_property (GObject *object,
case PROP_IS_INITIAL:
g_value_set_boolean (value, self->priv->is_initial);
break;
+ case PROP_IS_FOR_GREETER:
+ g_value_set_boolean (value, self->priv->is_for_greeter);
+ break;
case PROP_HAVE_EXISTING_USER_ACCOUNTS:
g_value_set_boolean (value, self->priv->have_existing_user_accounts);
break;
@@ -1248,6 +1266,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
+ PROP_IS_FOR_GREETER,
+ g_param_spec_boolean ("is-for-greeter",
+ NULL,
+ NULL,
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
PROP_ALLOW_TIMED_LOGIN,
g_param_spec_boolean ("allow-timed-login",
NULL,
@@ -1470,6 +1495,8 @@ void
gdm_display_set_up_greeter_session (GdmDisplay *self,
char **username)
{
+ g_return_if_fail (self->priv->is_for_greeter);
+
self->priv->doing_initial_setup = wants_initial_setup (self);
if (self->priv->doing_initial_setup) {
@@ -1488,6 +1515,8 @@ gdm_display_start_greeter_session (GdmDisplay *self)
char *hostname;
char *auth_file;
+ g_return_if_fail (self->priv->is_for_greeter);
+
g_debug ("GdmDisplay: Running greeter");
display_name = NULL;
diff --git a/daemon/gdm-local-display.c b/daemon/gdm-local-display.c
index 6fc2e60..3df2cdb 100644
--- a/daemon/gdm-local-display.c
+++ b/daemon/gdm-local-display.c
@@ -92,14 +92,20 @@ gdm_local_display_prepare (GdmDisplay *display)
GdmLaunchEnvironment *launch_environment;
char *seat_id;
gboolean doing_initial_setup = FALSE;
+ gboolean is_for_greeter = FALSE;
seat_id = NULL;
g_object_get (self,
"seat-id", &seat_id,
"doing-initial-setup", &doing_initial_setup,
+ "is-for-greeter", &is_for_greeter,
NULL);
+ if (!is_for_greeter) {
+ goto out;
+ }
+
if (!doing_initial_setup) {
launch_environment = gdm_create_greeter_launch_environment (NULL,
seat_id,
@@ -115,6 +121,7 @@ gdm_local_display_prepare (GdmDisplay *display)
g_object_set (self, "launch-environment", launch_environment, NULL);
g_object_unref (launch_environment);
+out:
return GDM_DISPLAY_CLASS (gdm_local_display_parent_class)->prepare (display);
}
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index b7754ae..42aa635 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1454,6 +1454,7 @@ set_up_greeter_session (GdmManager *manager,
if (!will_autologin) {
gdm_display_set_up_greeter_session (display, &allowed_user);
} else {
+ g_object_set (G_OBJECT (display), "is-for-greeter", FALSE, NULL);
allowed_user = g_strdup ("root");
}
@@ -1627,6 +1628,7 @@ on_start_user_session (StartUserSessionOperation *operation)
* the user session display. Kill the greeter on this session
* and let the user session follow the same display. */
gdm_display_stop_greeter_session (display);
+ g_object_set (G_OBJECT (display), "is-for-greeter", FALSE, NULL);
} else {
uid_t allowed_uid;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]