diff options
author | Marc Deslauriers <marc.deslauriers@canonical.com> | 2013-09-25 18:23:58 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-09-25 18:23:58 +0000 |
commit | 1a2e1d7719d699308ac22a05127b45f2248a3516 (patch) | |
tree | f26c67cc00ae600d6647dadcecfd218d3dd7c071 | |
parent | b7a8f35077f950dc6dab640e759341c1c2476f5c (diff) | |
parent | 7b020f0a6e02172cfbb0196607ad86b477d30ad2 (diff) | |
download | ayatana-indicator-session-1a2e1d7719d699308ac22a05127b45f2248a3516.tar.gz ayatana-indicator-session-1a2e1d7719d699308ac22a05127b45f2248a3516.tar.bz2 ayatana-indicator-session-1a2e1d7719d699308ac22a05127b45f2248a3516.zip |
* src/service.c: don't switch to greeter when locking screen, as that
switches away from the user's audio, power preferences, etc.
(LP: #1220201)
. Fixes: https://bugs.launchpad.net/bugs/1220201.
Approved by PS Jenkins bot, Charles Kerr.
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | src/service.c | 15 | ||||
-rw-r--r-- | tests/test-service.cc | 20 |
3 files changed, 25 insertions, 18 deletions
diff --git a/debian/changelog b/debian/changelog index d4f1a25..8c5255c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +indicator-session (12.10.5+13.10.20130823-0ubuntu2) UNRELEASED; urgency=low + + * src/service.c: don't switch to greeter when locking screen, as that + switches away from the user's audio, power preferences, etc. + (LP: #1220201) + + -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Fri, 20 Sep 2013 14:28:32 -0400 + indicator-session (12.10.5+13.10.20130823-0ubuntu1) saucy; urgency=low [ Charles Kerr ] diff --git a/src/service.c b/src/service.c index b7b1ba2..efcb04f 100644 --- a/src/service.c +++ b/src/service.c @@ -464,16 +464,15 @@ create_switch_section (IndicatorSessionService * self) item = g_menu_item_new (ellipsis ? _("Switch Account…") : _("Switch Account"), action); } - else if (g_hash_table_size (p->users) == 1) - { - const char * action = "indicator.switch-to-greeter"; - item = g_menu_item_new (_("Lock"), action); - } else { - const char * action = "indicator.switch-to-greeter"; - item = g_menu_item_new (ellipsis ? _("Lock/Switch Account…") - : _("Lock/Switch Account"), action); + const char * action = "indicator.switch-to-screensaver"; + + if (g_hash_table_size (p->users) == 1) + item = g_menu_item_new (_("Lock"), action); + else + item = g_menu_item_new (ellipsis ? _("Lock/Switch Account…") + : _("Lock/Switch Account"), action); } str = g_settings_get_string (p->keybinding_settings, "screensaver"); g_menu_item_set_attribute (item, "accel", "s", str); diff --git a/tests/test-service.cc b/tests/test-service.cc index b199175..19ec619 100644 --- a/tests/test-service.cc +++ b/tests/test-service.cc @@ -504,7 +504,7 @@ TEST_F (ServiceTest, ConfirmationDisabledByBackend) bool confirm = confirm_supported && !confirm_disabled; // confirm that the ellipsis are correct - ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.switch-to-greeter")); + ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.switch-to-screensaver")); ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.logout")); if (action_menuitem_exists ("indicator.reboot")) ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.reboot")); @@ -538,7 +538,7 @@ TEST_F (ServiceTest, ConfirmationDisabledByUser) bool confirm = confirm_supported && !confirm_disabled; // confirm that the ellipsis are correct - ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.switch-to-greeter")); + ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.switch-to-screensaver")); ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.logout")); if (action_menuitem_exists ("indicator.reboot")) ASSERT_EQ (confirm, action_menuitem_label_is_ellipsized ("indicator.reboot")); @@ -570,7 +570,7 @@ TEST_F (ServiceTest, DefaultMenuItems) ASSERT_TRUE (find_menu_item_for_action ("indicator.about", NULL, NULL)); ASSERT_TRUE (find_menu_item_for_action ("indicator.help", NULL, NULL)); ASSERT_TRUE (find_menu_item_for_action ("indicator.settings", NULL, NULL)); - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", NULL, NULL)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", NULL, NULL)); ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-guest", NULL, NULL)); ASSERT_TRUE (find_menu_item_for_action ("indicator.logout", NULL, NULL)); ASSERT_TRUE (find_menu_item_for_action ("indicator.suspend", NULL, NULL)); @@ -681,10 +681,10 @@ TEST_F (ServiceTest, User) }; // Find the switcher menu model. - // In BackendMock's default setup, it will only two menuitems: greeter & guest + // In BackendMock's default setup, it will only have two menuitems: lockswitch & guest int pos = 0; GMenuModel * switch_menu = 0; - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (2, g_menu_model_get_n_items (switch_menu)); g_clear_object (&switch_menu); @@ -709,7 +709,7 @@ TEST_F (ServiceTest, User) wait_for_menu_resync (); // now there should be 7 menuitems: greeter + guest + the five doctors - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (7, g_menu_model_get_n_items (switch_menu)); // confirm that the doctor names are sorted @@ -727,7 +727,7 @@ TEST_F (ServiceTest, User) wait_for_menu_resync (); // now there should be 5 menuitems: greeter + guest + the three doctors - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (5, g_menu_model_get_n_items (switch_menu)); // confirm that the doctor names are sorted @@ -744,7 +744,7 @@ TEST_F (ServiceTest, User) wait_for_menu_resync (); // now there should be 5 menuitems: greeter + guest + the three doctors - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (5, g_menu_model_get_n_items (switch_menu)); g_clear_object (&switch_menu); @@ -770,7 +770,7 @@ TEST_F (ServiceTest, User) g_object_get (service, "max-users", &max_users, NULL); ASSERT_EQ (2, max_users); wait_for_menu_resync (); - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (4, g_menu_model_get_n_items (switch_menu)); check_label ("First Doctor", switch_menu, 2); @@ -800,7 +800,7 @@ TEST_F (ServiceTest, User) users[10]->is_logged_in = true; indicator_session_users_changed (mock_users, users[10]->uid); wait_for_menu_resync (); - ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-greeter", &switch_menu, &pos)); + ASSERT_TRUE (find_menu_item_for_action ("indicator.switch-to-screensaver", &switch_menu, &pos)); ASSERT_EQ (0, pos); ASSERT_EQ (9, g_menu_model_get_n_items (switch_menu)); check_label ("Eleventh Doctor", switch_menu, 2); |