Merge lp:~townsend/unity/fix-lp1267888 into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3622
Proposed branch: lp:~townsend/unity/fix-lp1267888
Merge into: lp:unity
Diff against target: 35 lines (+4/-10)
2 files modified
launcher/ApplicationLauncherIcon.cpp (+2/-8)
tests/test_application_launcher_icon.cpp (+2/-2)
To merge this branch: bzr merge lp:~townsend/unity/fix-lp1267888
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+201255@code.launchpad.net

Commit message

When using the mouse scrollwheel on inactive Launcher icons with unfocused windows, the unfocused window should not be focused.

Description of the change

= Issue =
In bug #1081843, the design for using the mouse scroll wheel over Launcher icons of unfocused apps led to an inconsistent behavior. In that bug, Mark Shuttleworth said the design was wrong.

= Fix =
Do not focus any windows if the Launcher icon is not active.

= Test =
Modified the already in place unit test to account for the new, correct behavior.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/ApplicationLauncherIcon.cpp'
2--- launcher/ApplicationLauncherIcon.cpp 2014-01-09 21:27:27 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2014-01-10 21:36:13 +0000
4@@ -1315,14 +1315,8 @@
5
6 auto const& windows = GetWindowsOnCurrentDesktopInStackingOrder();
7
8- if (windows.size() <= 1)
9- return;
10-
11- if (!IsActive())
12- {
13- windows.at(0)->Focus();
14- return;
15- }
16+ if (!IsActive() || windows.size() <= 1)
17+ return;
18
19 ++_progressive_scroll;
20 _progressive_scroll %= windows.size();
21
22=== modified file 'tests/test_application_launcher_icon.cpp'
23--- tests/test_application_launcher_icon.cpp 2014-01-09 21:27:27 +0000
24+++ tests/test_application_launcher_icon.cpp 2014-01-10 21:36:13 +0000
25@@ -718,8 +718,8 @@
26 ASSERT_EQ(WM->GetActiveWindow(), 8);
27
28 mock_icon->PerformScroll(AbstractLauncherIcon::ScrollDirection::DOWN, 200);
29- EXPECT_THAT(WM->GetWindowsInStackingOrder(), testing::ElementsAre(7, 6, 5, 4, 3, 2, 8, 1));
30- ASSERT_EQ(WM->GetActiveWindow(), 1);
31+ EXPECT_THAT(WM->GetWindowsInStackingOrder(), testing::ElementsAre(7, 6, 5, 4, 3, 2, 1, 8));
32+ ASSERT_EQ(WM->GetActiveWindow(), 8);
33 }
34
35 TEST_F(TestApplicationLauncherIcon, PerformScrollSingleUnfocusedWindow)