diff options
author | Dmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com> | 2012-10-17 23:46:05 +0100 |
---|---|---|
committer | Dmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com> | 2012-10-17 23:46:05 +0100 |
commit | 82491e95e6f91096d014dacbd78779aa32c53188 (patch) | |
tree | f223e1365aefb9f7525bd2a5d6c0389a3a4d0211 /src | |
parent | 57b62d5fa18525811e1a4b413b1c6b966b5f28f8 (diff) | |
download | ayatana-indicator-session-82491e95e6f91096d014dacbd78779aa32c53188.tar.gz ayatana-indicator-session-82491e95e6f91096d014dacbd78779aa32c53188.tar.bz2 ayatana-indicator-session-82491e95e6f91096d014dacbd78779aa32c53188.zip |
Hide "Start Screen Saver" action, if it is locked down.
Diffstat (limited to 'src')
-rw-r--r-- | src/session-menu-mgr.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c index 394110c..697218f 100644 --- a/src/session-menu-mgr.c +++ b/src/session-menu-mgr.c @@ -65,7 +65,8 @@ typedef enum SWITCHER_MODE_SCREENSAVER, SWITCHER_MODE_LOCK, SWITCHER_MODE_SWITCH, - SWITCHER_MODE_SWITCH_OR_LOCK + SWITCHER_MODE_SWITCH_OR_LOCK, + SWITCHER_MODE_NONE } SwitcherMode; @@ -956,9 +957,12 @@ build_user_menuitems (SessionMenuMgr * mgr) g_list_free (users); /* separator */ - mi = mi_new_separator (); - dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++); - items = g_slist_prepend (items, mi); + if (mode != SWITCHER_MODE_SCREENSAVER && !is_guest && guest_allowed) + { + mi = mi_new_separator (); + dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++); + items = g_slist_prepend (items, mi); + } if (current_real_name != NULL) { @@ -1147,7 +1151,7 @@ get_switcher_mode (SessionMenuMgr * mgr) if (!can_lock && !can_switch) /* hmm, quite an extreme lockdown */ { - mode = SWITCHER_MODE_SCREENSAVER; + mode = SWITCHER_MODE_NONE; } else if (is_this_live_session()) /* live sessions can't lock or switch */ { |