Merge lp:~3v1n0/unity/switcher-app-middle-click into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4114
Proposed branch: lp:~3v1n0/unity/switcher-app-middle-click
Merge into: lp:unity
Diff against target: 106 lines (+10/-21)
4 files modified
launcher/SwitcherController.cpp (+0/-4)
launcher/SwitcherView.cpp (+8/-10)
launcher/SwitcherView.h (+0/-4)
tests/test_switcher_controller.cpp (+2/-3)
To merge this branch: bzr merge lp:~3v1n0/unity/switcher-app-middle-click
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Azzarone (community) Approve
Review via email: mp+292814@code.launchpad.net

Commit message

SwitcherView: close the mouse-selected application on middle-click

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
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/SwitcherController.cpp'
2--- launcher/SwitcherController.cpp 2016-03-21 15:38:17 +0000
3+++ launcher/SwitcherController.cpp 2016-04-25 15:17:48 +0000
4@@ -453,10 +453,6 @@
5 view_->background_color = WindowManager::Default().average_color();
6 view_->monitor = obj_->monitor_;
7 view_->hide_request.connect(sigc::mem_fun(this, &Controller::Impl::Hide));
8- view_->switcher_mouse_up.connect([this] (int icon_index, int button) {
9- if (button == 3)
10- InitiateDetail(true);
11- });
12
13 view_->switcher_mouse_move.connect([this] (int icon_index) {
14 if (icon_index >= 0)
15
16=== modified file 'launcher/SwitcherView.cpp'
17--- launcher/SwitcherView.cpp 2016-03-21 15:38:17 +0000
18+++ launcher/SwitcherView.cpp 2016-04-25 15:17:48 +0000
19@@ -381,8 +381,6 @@
20 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
21
22 last_detail_icon_selected_ = detail_icon_index;
23-
24- switcher_mouse_down.emit(detail_icon_index, button);
25 }
26
27 void SwitcherView::HandleMouseDown(int x, int y, int button)
28@@ -390,8 +388,6 @@
29 int icon_index = IconIndexAt(x,y);
30
31 last_icon_selected_ = icon_index;
32-
33- switcher_mouse_down.emit(icon_index, button);
34 }
35
36 void SwitcherView::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long /*key_flags*/)
37@@ -413,8 +409,6 @@
38 nux::Point const& mouse_pos = CalculateMouseMonitorOffset(x, y);
39 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
40
41- switcher_mouse_up.emit(detail_icon_index, button);
42-
43 if (button == 1)
44 {
45 if (detail_icon_index >= 0 && detail_icon_index == last_detail_icon_selected_)
46@@ -437,14 +431,18 @@
47 {
48 int icon_index = IconIndexAt(x,y);
49
50- switcher_mouse_up.emit(icon_index, button);
51-
52- if (button == 1)
53+ if (button == 1 || button == 2 || button == 3)
54 {
55 if (icon_index >= 0 && icon_index == last_icon_selected_)
56 {
57 model_->Select(icon_index);
58- hide_request.emit(true);
59+
60+ if (button == 1)
61+ hide_request.emit(true);
62+ else if (button == 2)
63+ switcher_close_current.emit();
64+ else if (button == 3)
65+ switcher_start_detail.emit();
66 }
67 }
68 }
69
70=== modified file 'launcher/SwitcherView.h'
71--- launcher/SwitcherView.h 2015-11-02 18:28:31 +0000
72+++ launcher/SwitcherView.h 2016-04-25 15:17:48 +0000
73@@ -73,10 +73,6 @@
74 int IconIndexAt(int x, int y) const;
75 int DetailIconIdexAt(int x, int y) const;
76
77- /* void; int icon_index, int button*/
78- sigc::signal<void, int, int> switcher_mouse_down;
79- sigc::signal<void, int, int> switcher_mouse_up;
80-
81 /* void; int icon_index */
82 sigc::signal<void, int> switcher_mouse_move;
83
84
85=== modified file 'tests/test_switcher_controller.cpp'
86--- tests/test_switcher_controller.cpp 2015-11-04 09:42:55 +0000
87+++ tests/test_switcher_controller.cpp 2016-04-25 15:17:48 +0000
88@@ -278,7 +278,7 @@
89 Mock::VerifyAndClearExpectations(mock_window_.GetPointer());
90 }
91
92-TEST_F(TestSwitcherController, TestRightClickedReceived)
93+TEST_F(TestSwitcherController, TestDetailActivationRequest)
94 {
95 controller_->Show(ShowMode::ALL, SortMode::LAUNCHER_ORDER, icons_);
96
97@@ -287,8 +287,7 @@
98
99 ASSERT_FALSE(model->detail_selection());
100
101- view->switcher_mouse_up.emit(-1, 3);
102- view->switcher_mouse_down.emit(-1, 3);
103+ view->switcher_start_detail.emit();
104
105 ASSERT_TRUE(model->detail_selection());
106 }