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

Proposed by Dimitri John Ledkov on 2012-10-17
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 on 2012-10-18
Charles Kerr (community) 2012-10-17 Approve on 2012-10-18
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.
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

Charles Kerr (charlesk) wrote :

Thanks!

review: Approve
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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
1=== modified file 'src/session-menu-mgr.c'
2--- src/session-menu-mgr.c 2012-10-10 17:24:51 +0000
3+++ src/session-menu-mgr.c 2012-10-17 22:49:20 +0000
4@@ -65,7 +65,8 @@
5 SWITCHER_MODE_SCREENSAVER,
6 SWITCHER_MODE_LOCK,
7 SWITCHER_MODE_SWITCH,
8- SWITCHER_MODE_SWITCH_OR_LOCK
9+ SWITCHER_MODE_SWITCH_OR_LOCK,
10+ SWITCHER_MODE_NONE
11 }
12 SwitcherMode;
13
14@@ -956,9 +957,12 @@
15 g_list_free (users);
16
17 /* separator */
18- mi = mi_new_separator ();
19- dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++);
20- items = g_slist_prepend (items, mi);
21+ if (mode != SWITCHER_MODE_SCREENSAVER && !is_guest && guest_allowed)
22+ {
23+ mi = mi_new_separator ();
24+ dbusmenu_menuitem_child_add_position (mgr->top_mi, mi, pos++);
25+ items = g_slist_prepend (items, mi);
26+ }
27
28 if (current_real_name != NULL)
29 {
30@@ -1147,7 +1151,7 @@
31
32 if (!can_lock && !can_switch) /* hmm, quite an extreme lockdown */
33 {
34- mode = SWITCHER_MODE_SCREENSAVER;
35+ mode = SWITCHER_MODE_NONE;
36 }
37 else if (is_this_live_session()) /* live sessions can't lock or switch */
38 {

Subscribers

People subscribed via source and target branches