aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-30 11:55:38 -0500
committerTed Gould <ted@canonical.com>2009-09-30 11:55:38 -0500
commit16650e8f453d7ac06ea808a3ca45e18ab3383967 (patch)
tree4c94b1c07cbfd450bbd3c8252ef7c30376a13937
parent59b1a709d947252f9eaaecbdf1ffd74ab25e869f (diff)
parent13cb4dfa96124d14aaf86b422ff47c481acbcd49 (diff)
downloadayatana-indicator-session-16650e8f453d7ac06ea808a3ca45e18ab3383967.tar.gz
ayatana-indicator-session-16650e8f453d7ac06ea808a3ca45e18ab3383967.tar.bz2
ayatana-indicator-session-16650e8f453d7ac06ea808a3ca45e18ab3383967.zip
Making the lock screen item insensitive for guest accounts.
-rw-r--r--src/users-service.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/users-service.c b/src/users-service.c
index 894b832..9877ba6 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -54,6 +54,7 @@ static GMainLoop *mainloop = NULL;
static UsersServiceDbus *dbus_interface = NULL;
static DbusmenuMenuitem *lock_menuitem = NULL;
+static gboolean is_guest = FALSE;
static DBusGProxy * gdm_settings_proxy = NULL;
static gboolean gdm_auto_login = FALSE;
@@ -81,7 +82,7 @@ gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old,
}
if (lock_menuitem != NULL) {
- if (gdm_auto_login) {
+ if (gdm_auto_login || is_guest) {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
} else {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
@@ -291,7 +292,7 @@ rebuild_items (DbusmenuMenuitem *root,
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
dbusmenu_menuitem_child_append(root, lock_menuitem);
- if (gdm_auto_login) {
+ if (gdm_auto_login || is_guest) {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
} else {
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
@@ -409,6 +410,10 @@ main (int argc, char ** argv)
return 1;
}
+ if (!g_strcmp0(g_get_user_name(), "guest")) {
+ is_guest = TRUE;
+ }
+
g_idle_add(build_gdm_proxy, NULL);
dbus_interface = g_object_new (USERS_SERVICE_DBUS_TYPE, NULL);