diff options
author | Ray Strode <rstrode@redhat.com> | 2015-02-17 17:22:57 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2015-02-18 17:34:16 -0500 |
commit | 3b6695247eb6de7330f8d1ea7ce41b94f0185cab (patch) | |
tree | 02ec38db29dc2dbbea86f31efe7debc1199ff212 /daemon/gdm-display.c | |
parent | ec374187b14e0c03591383a1bedd31d725ff114d (diff) | |
download | gdm-3b6695247eb6de7330f8d1ea7ce41b94f0185cab.tar.gz |
display: only add user authorization if connected to display
If we aren't connected to the display then we can't give
the user access to it,(and we don't need to anyway)
This commit adds a new is-connected property to GdmDisplay and
changes the code to never give a user authorization if we
aren't connected.
https://bugzilla.gnome.org/show_bug.cgi?id=744764
Diffstat (limited to 'daemon/gdm-display.c')
-rw-r--r-- | daemon/gdm-display.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c index c8f38f16..6bdb1fc3 100644 --- a/daemon/gdm-display.c +++ b/daemon/gdm-display.c @@ -107,6 +107,7 @@ enum { PROP_X11_DISPLAY_NAME, PROP_X11_COOKIE, PROP_X11_AUTHORITY_FILE, + PROP_IS_CONNECTED, PROP_IS_LOCAL, PROP_LAUNCH_ENVIRONMENT, PROP_IS_INITIAL, @@ -1005,6 +1006,9 @@ gdm_display_get_property (GObject *object, case PROP_IS_LOCAL: g_value_set_boolean (value, self->priv->is_local); break; + case PROP_IS_CONNECTED: + g_value_set_boolean (value, self->priv->x11_display != NULL); + break; case PROP_LAUNCH_ENVIRONMENT: g_value_set_object (value, self->priv->launch_environment); break; @@ -1307,6 +1311,13 @@ gdm_display_class_init (GdmDisplayClass *klass) TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, + PROP_IS_CONNECTED, + g_param_spec_boolean ("is-connected", + NULL, + NULL, + TRUE, + G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_HAVE_EXISTING_USER_ACCOUNTS, g_param_spec_boolean ("have-existing-user-accounts", NULL, @@ -1782,6 +1793,10 @@ gdm_display_connect (GdmDisplay *self) ret = TRUE; } + if (ret == TRUE) { + g_object_notify (G_OBJECT (self), "is-connected"); + } + return ret; } |