aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrijs Ledkovs (xnox) <Unknown>2012-10-24 16:11:44 +0200
committerCharles Kerr <charles.kerr@canonical.com>2012-10-24 16:11:44 +0200
commitccc363f909fc8e2ecc571e83e18c12f46b771c1c (patch)
treec40dbc096d59443914292a0c0b38290ec7284464
parent23518863d95772f0ed766a84130314ec10141112 (diff)
parent82491e95e6f91096d014dacbd78779aa32c53188 (diff)
downloadayatana-indicator-session-ccc363f909fc8e2ecc571e83e18c12f46b771c1c.tar.gz
ayatana-indicator-session-ccc363f909fc8e2ecc571e83e18c12f46b771c1c.tar.bz2
ayatana-indicator-session-ccc363f909fc8e2ecc571e83e18c12f46b771c1c.zip
Hide 'start screen saver' action, if it's locked down. Approved by Charles Kerr.
-rw-r--r--src/session-menu-mgr.c14
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 */
{