Merge lp:~thumper/unity/unity.alt-tab-workspaces into lp:unity

Proposed by Tim Penhey
Status: Merged
Approved by: Thomi Richards
Approved revision: no longer in the source branch.
Merged at revision: 2032
Proposed branch: lp:~thumper/unity/unity.alt-tab-workspaces
Merge into: lp:unity
Diff against target: 37 lines (+19/-3)
2 files modified
manual-tests/Switcher.txt (+18/-0)
plugins/unityshell/src/unityshell.cpp (+1/-3)
To merge this branch: bzr merge lp:~thumper/unity/unity.alt-tab-workspaces
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Tim Penhey Pending
Review via email: mp+94906@code.launchpad.net

This proposal supersedes a proposal from 2012-02-22.

Description of the change

Code correctness fix.
Fixes potential multi-monitor issue with alt-tab getting settings confused.

= Problem description =

We passed an int into a function expecting a bool. This caused the switcher to confuse its settings and act weirdly.

= The fix =

We pass a bool now.

= Test coverage =

Existing tests cover a degree of this behavior. Currently testing does not cover multi-monitor behavior however (which is where this bug showed up). The fix is obvious and the current code is clearly and demonstrably wrong, to the point of passing the wrong type into a function.

A manual test was added for the multi-monitor work.

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote : Posted in a previous version of this proposal

Needs testing

review: Needs Fixing
Revision history for this message
Tim Penhey (thumper) wrote : Posted in a previous version of this proposal

Again a manual test describing the expected behaviour should be sufficient.

In what situation with multiple monitors was this getting broken?

review: Needs Information
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Looks good with manual test.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'manual-tests/Switcher.txt'
2--- manual-tests/Switcher.txt 1970-01-01 00:00:00 +0000
3+++ manual-tests/Switcher.txt 2012-02-28 03:59:18 +0000
4@@ -0,0 +1,18 @@
5+Multi-monitor Alt-Tab
6+---------------------
7+This test only applies for multiple monitor.
8+App names here are an example, any apps will do.
9+
10+#. Start with no apps open (or at least remember what is open where)
11+#. Start terminal on workspace 1
12+#. Start firefox on workspace 2
13+#. Move to workspace 2
14+
15+Now do the following on both monitors
16+
17+#. Hold Alt, and press Tab, hold and observe
18+#. Release Alt.
19+
20+Outcomes
21+ While alt is held, Firefox should appear in the tab list, and
22+ terminal should not
23
24=== modified file 'plugins/unityshell/src/unityshell.cpp'
25--- plugins/unityshell/src/unityshell.cpp 2012-02-26 00:58:30 +0000
26+++ plugins/unityshell/src/unityshell.cpp 2012-02-28 03:59:18 +0000
27@@ -1601,9 +1601,7 @@
28
29 RaiseInputWindows();
30
31- int show_monitor = (show_mode == switcher::ShowMode::CURRENT_VIEWPORT) ? device : -1;
32-
33- auto results = launcher_controller_->GetAltTabIcons(show_monitor);
34+ auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT);
35
36 if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_BEGIN))
37 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);