Merge lp:~azzar1/unity/lp-1133338 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: no longer in the source branch.
Merged at revision: 3174
Proposed branch: lp:~azzar1/unity/lp-1133338
Merge into: lp:unity
Diff against target: 71 lines (+17/-1)
4 files modified
launcher/SwitcherController.cpp (+10/-0)
launcher/SwitcherController.h (+1/-0)
launcher/SwitcherControllerImpl.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+5/-1)
To merge this branch: bzr merge lp:~azzar1/unity/lp-1133338
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
MC Return (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+150574@code.launchpad.net

Commit message

Switcher must focus the last active window in detail mode (using alt+grave too)

Description of the change

== Problem ==
Switcher does not focus the last active window in detail mode (using alt+grave)

== Test ==
Fix a failing AP test. See bug description.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

LGTM.

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Looking good +1

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

It's fine for now. I've been wondering though if we shouldn't maybe just handle it better in the switcher controller then, instead of doing it in the plugin. And maybe we should take a look at altTabPrevWindowInitiate() as well.

But this is good as it is anyway!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/SwitcherController.cpp'
2--- launcher/SwitcherController.cpp 2013-02-18 18:31:45 +0000
3+++ launcher/SwitcherController.cpp 2013-02-26 16:29:26 +0000
4@@ -139,6 +139,11 @@
5 return impl_->GetView();
6 }
7
8+bool Controller::IsDetailViewShown()
9+{
10+ return impl_->IsDetailViewShown();
11+}
12+
13 void Controller::SetDetail(bool value, unsigned int min_windows)
14 {
15 impl_->SetDetail(value, min_windows);
16@@ -522,6 +527,11 @@
17 return view_;
18 }
19
20+bool Controller::Impl::IsDetailViewShown()
21+{
22+ return model_ && model_->detail_selection();
23+}
24+
25 void Controller::Impl::SetDetail(bool value, unsigned int min_windows)
26 {
27 if (value && model_->DetailXids().size() >= min_windows)
28
29=== modified file 'launcher/SwitcherController.h'
30--- launcher/SwitcherController.h 2013-02-07 17:06:56 +0000
31+++ launcher/SwitcherController.h 2013-02-26 16:29:26 +0000
32@@ -98,6 +98,7 @@
33
34 void Select(int index);
35
36+ bool IsDetailViewShown();
37 void SetDetail(bool detail,
38 unsigned int min_windows = 1);
39
40
41=== modified file 'launcher/SwitcherControllerImpl.h'
42--- launcher/SwitcherControllerImpl.h 2013-02-07 17:06:56 +0000
43+++ launcher/SwitcherControllerImpl.h 2013-02-26 16:29:26 +0000
44@@ -56,6 +56,7 @@
45 void NextDetail();
46 void PrevDetail();
47
48+ bool IsDetailViewShown();
49 void SetDetail(bool detail, unsigned int min_windows = 1);
50
51 void SelectFirstItem();
52
53=== modified file 'plugins/unityshell/src/unityshell.cpp'
54--- plugins/unityshell/src/unityshell.cpp 2013-02-21 16:43:01 +0000
55+++ plugins/unityshell/src/unityshell.cpp 2013-02-26 16:29:26 +0000
56@@ -2064,10 +2064,14 @@
57 switcher_controller_->Select((switcher_controller_->StartIndex())); // always select the current application
58 switcher_controller_->InitiateDetail();
59 }
60- else
61+ else if (switcher_controller_->IsDetailViewShown())
62 {
63 switcher_controller_->NextDetail();
64 }
65+ else
66+ {
67+ switcher_controller_->SetDetail(true);
68+ }
69
70 action->setState(action->state() | CompAction::StateTermKey);
71 return true;