diff options
author | Ted Gould <ted@gould.cx> | 2010-03-15 14:11:55 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-15 14:11:55 -0500 |
commit | da365cbe9598860cc4e74938ded3ad735a6db396 (patch) | |
tree | 80dda351d6d851a37beddc47982553af92ec635a | |
parent | aa52289c19291ffa9bc4ed70f67d1f683cbf6381 (diff) | |
download | ayatana-indicator-session-da365cbe9598860cc4e74938ded3ad735a6db396.tar.gz ayatana-indicator-session-da365cbe9598860cc4e74938ded3ad735a6db396.tar.bz2 ayatana-indicator-session-da365cbe9598860cc4e74938ded3ad735a6db396.zip |
Tracking the separator next to the lock item as well.
-rw-r--r-- | src/session-service.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/session-service.c b/src/session-service.c index 24623aa..b976236 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -73,6 +73,7 @@ static UsersServiceDbus *dbus_interface = NULL; static SessionDbus *session_dbus = NULL; static DbusmenuMenuitem *lock_menuitem = NULL; +static DbusmenuMenuitem *lock_separator = NULL; static DbusmenuMenuitem *switch_menuitem = NULL; static DbusmenuMenuitem * root_menuitem = NULL; @@ -116,9 +117,11 @@ lockdown_changed (GConfClient *client, } else if (g_strcmp0 (key, LOCKDOWN_KEY_SCREENSAVER) == 0) { if (lock_menuitem != NULL) { if (gconf_value_get_bool (value)) { - dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + dbusmenu_menuitem_property_set_bool (lock_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); } else { - dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + dbusmenu_menuitem_property_set_bool (lock_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); } } } @@ -464,12 +467,14 @@ rebuild_items (DbusmenuMenuitem *root, } else { dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); } + lock_separator = NULL; if (can_activate == TRUE) { DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(separator1, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_append(root, separator1); + lock_separator = separator1; if (check_guest_session ()) { @@ -554,6 +559,9 @@ rebuild_items (DbusmenuMenuitem *root, DbusmenuMenuitem * separator = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_append(root, separator); + if (lock_separator == NULL) { + lock_separator = separator; + } logout_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { |