aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);