Merge lp:~xnox/indicator-session/fix-screensaver-does-nothing into lp:indicator-session/13.04

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 369
Proposed branch: lp:~xnox/indicator-session/fix-screensaver-does-nothing
Merge into: lp:indicator-session/13.04
Diff against target: 38 lines (+9/-5)
1 file modified
src/session-menu-mgr.c (+9/-5)
To merge this branch: bzr merge lp:~xnox/indicator-session/fix-screensaver-does-nothing
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) Needs Fixing
Charles Kerr (community) Approve
Review via email: mp+130252@code.launchpad.net

Commit message

Hide "Start Screen Saver" action, if it is locked down. (LP: #1066825)

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

In the case of (!can_lock && !can_switch) the SWITCHER_MODE_SCREENSAVER shows action "Start Screen Saver", but that action does nothing, since the lock_helper doesn't do anything if (!can_switch).

So instead of showing an item that does nothing, hide it by introducing SWITCHER_MODE_NONE. If there is also no guest sessions, we get duplicate separators back to back, so hide that as well.

Steps to reproduce the linked bug are:
* Boot into live-cd
* Observe that "Start Screen Saver" action does nothing

Revision history for this message
Charles Kerr (charlesk) wrote :

Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Do I need to resubmit or will Jenkins notice the new commit message? =P

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/session-menu-mgr.c'
--- src/session-menu-mgr.c 2012-10-10 17:24:51 +0000
+++ src/session-menu-mgr.c 2012-10-17 22:49:20 +0000
@@ -65,7 +65,8 @@
65 SWITCHER_MODE_SCREENSAVER,65 SWITCHER_MODE_SCREENSAVER,
66 SWITCHER_MODE_LOCK,66 SWITCHER_MODE_LOCK,
67 SWITCHER_MODE_SWITCH,67 SWITCHER_MODE_SWITCH,
68 SWITCHER_MODE_SWITCH_OR_LOCK68 SWITCHER_MODE_SWITCH_OR_LOCK,
69 SWITCHER_MODE_NONE
69}70}
70SwitcherMode;71SwitcherMode;
7172
@@ -956,9 +957,12 @@
956 g_list_free (users);957 g_list_free (users);
957958
958 /* separator */959 /* separator */
959 mi = mi_new_separator ();960 if (mode != SWITCHER_MODE_SCREENSAVER && !is_guest && guest_allowed)
960 dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++);961 {
961 items = g_slist_prepend (items, mi);962 mi = mi_new_separator ();
963 dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++);
964 items = g_slist_prepend (items, mi);
965 }
962966
963 if (current_real_name != NULL)967 if (current_real_name != NULL)
964 {968 {
@@ -1147,7 +1151,7 @@
11471151
1148 if (!can_lock && !can_switch) /* hmm, quite an extreme lockdown */1152 if (!can_lock && !can_switch) /* hmm, quite an extreme lockdown */
1149 {1153 {
1150 mode = SWITCHER_MODE_SCREENSAVER;1154 mode = SWITCHER_MODE_NONE;
1151 }1155 }
1152 else if (is_this_live_session()) /* live sessions can't lock or switch */1156 else if (is_this_live_session()) /* live sessions can't lock or switch */
1153 {1157 {

Subscribers

People subscribed via source and target branches