Merge lp:~brandontschaefer/unity/disable-switcher-when-wall-active into lp:unity
- disable-switcher-when-wall-active
- Merge into trunk
Proposed by
Brandon Schaefer
Status: | Merged |
---|---|
Approved by: | Brandon Schaefer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2551 |
Proposed branch: | lp:~brandontschaefer/unity/disable-switcher-when-wall-active |
Merge into: | lp:unity |
Diff against target: |
792 lines (+225/-176) 9 files modified
launcher/SwitcherController.cpp (+7/-0) launcher/SwitcherController.h (+2/-0) plugins/unityshell/src/unityshell.cpp (+4/-2) tests/autopilot/unity/tests/test_switcher.py (+16/-0) unity-shared/PluginAdapter.h (+23/-21) unity-shared/PluginAdapterCompiz.cpp (+25/-19) unity-shared/PluginAdapterStandalone.cpp (+70/-64) unity-shared/WindowManager.cpp (+59/-53) unity-shared/WindowManager.h (+19/-17) |
To merge this branch: | bzr merge lp:~brandontschaefer/unity/disable-switcher-when-wall-active |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Thomi Richards (community) | quality | Approve | |
Review via email: mp+117997@code.launchpad.net |
Commit message
Switcher is now disabled when the Wall plugin is Active.
Description of the change
=== Problem ===
When the wall plugin is active (while switching workspaces) Alt+Tab would pick up the wrong workspace.
=== Fix ===
When the wall plugin is active the switcher must be disabled. It is now.
=== Test ===
AP test
To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote : | # |
review:
Needs Fixing
(quality)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) : | # |
review:
Approve
(quality)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Fine for me.
review:
Approve
Revision history for this message
Unity Merger (unity-merger) wrote : | # |
Attempt to merge into lp:unity failed due to conflicts:
text conflict in plugins/
text conflict in tests/autopilot
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 2012-08-10 09:58:49 +0000 | |||
3 | +++ launcher/SwitcherController.cpp 2012-08-10 23:01:11 +0000 | |||
4 | @@ -70,6 +70,13 @@ | |||
5 | 70 | view_->background_color = bg_color_; | 70 | view_->background_color = bg_color_; |
6 | 71 | } | 71 | } |
7 | 72 | 72 | ||
8 | 73 | bool Controller::CanShowSwitcher(const std::vector<AbstractLauncherIcon::Ptr>& results) const | ||
9 | 74 | { | ||
10 | 75 | bool empty = (show_desktop_disabled_ ? results.empty() : results.size() == 1); | ||
11 | 76 | |||
12 | 77 | return (!empty && !WindowManager::Default()->IsWallActive()); | ||
13 | 78 | } | ||
14 | 79 | |||
15 | 73 | void Controller::Show(ShowMode show, SortMode sort, bool reverse, | 80 | void Controller::Show(ShowMode show, SortMode sort, bool reverse, |
16 | 74 | std::vector<AbstractLauncherIcon::Ptr> results) | 81 | std::vector<AbstractLauncherIcon::Ptr> results) |
17 | 75 | { | 82 | { |
18 | 76 | 83 | ||
19 | === modified file 'launcher/SwitcherController.h' | |||
20 | --- launcher/SwitcherController.h 2012-07-27 01:06:27 +0000 | |||
21 | +++ launcher/SwitcherController.h 2012-08-10 23:01:11 +0000 | |||
22 | @@ -70,6 +70,8 @@ | |||
23 | 70 | void Show(ShowMode show, SortMode sort, bool reverse, std::vector<launcher::AbstractLauncherIcon::Ptr> results); | 70 | void Show(ShowMode show, SortMode sort, bool reverse, std::vector<launcher::AbstractLauncherIcon::Ptr> results); |
24 | 71 | void Hide(bool accept_state=true); | 71 | void Hide(bool accept_state=true); |
25 | 72 | 72 | ||
26 | 73 | bool CanShowSwitcher(const std::vector<launcher::AbstractLauncherIcon::Ptr>& resutls) const; | ||
27 | 74 | |||
28 | 73 | bool Visible(); | 75 | bool Visible(); |
29 | 74 | 76 | ||
30 | 75 | void Next(); | 77 | void Next(); |
31 | 76 | 78 | ||
32 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
33 | --- plugins/unityshell/src/unityshell.cpp 2012-08-10 09:58:49 +0000 | |||
34 | +++ plugins/unityshell/src/unityshell.cpp 2012-08-10 23:01:11 +0000 | |||
35 | @@ -1895,7 +1895,7 @@ | |||
36 | 1895 | auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT, | 1895 | auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT, |
37 | 1896 | switcher_controller_->IsShowDesktopDisabled()); | 1896 | switcher_controller_->IsShowDesktopDisabled()); |
38 | 1897 | 1897 | ||
40 | 1898 | if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::DESKTOP) && !results.empty()) | 1898 | if (switcher_controller_->CanShowSwitcher(results)) |
41 | 1899 | switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results); | 1899 | switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results); |
42 | 1900 | 1900 | ||
43 | 1901 | return true; | 1901 | return true; |
44 | @@ -1949,7 +1949,9 @@ | |||
45 | 1949 | CompAction::State state, | 1949 | CompAction::State state, |
46 | 1950 | CompOption::Vector& options) | 1950 | CompOption::Vector& options) |
47 | 1951 | { | 1951 | { |
49 | 1952 | if (switcher_controller_->Visible()) | 1952 | if (WindowManager::Default()->IsWallActive()) |
50 | 1953 | return false; | ||
51 | 1954 | else if (switcher_controller_->Visible()) | ||
52 | 1953 | switcher_controller_->Next(); | 1955 | switcher_controller_->Next(); |
53 | 1954 | else | 1956 | else |
54 | 1955 | altTabInitiateCommon(action, switcher::ShowMode::ALL); | 1957 | altTabInitiateCommon(action, switcher::ShowMode::ALL); |
55 | 1956 | 1958 | ||
56 | === modified file 'tests/autopilot/unity/tests/test_switcher.py' | |||
57 | --- tests/autopilot/unity/tests/test_switcher.py 2012-08-09 01:37:02 +0000 | |||
58 | +++ tests/autopilot/unity/tests/test_switcher.py 2012-08-10 23:01:11 +0000 | |||
59 | @@ -417,3 +417,19 @@ | |||
60 | 417 | self.switcher.select() | 417 | self.switcher.select() |
61 | 418 | 418 | ||
62 | 419 | self.assertProperty(char_win2, is_hidden=False) | 419 | self.assertProperty(char_win2, is_hidden=False) |
63 | 420 | |||
64 | 421 | def test_switcher_is_disabled_when_wall_plugin_active(self): | ||
65 | 422 | """The switcher must not open when the wall plugin is active using ctrl+alt+<direction>.""" | ||
66 | 423 | |||
67 | 424 | initial_workspace = self.workspace.current_workspace | ||
68 | 425 | self.addCleanup(self.workspace.switch_to, initial_workspace) | ||
69 | 426 | |||
70 | 427 | self.workspace.switch_to(0) | ||
71 | 428 | sleep(1) | ||
72 | 429 | self.keyboard.press("Ctrl+Alt+Right") | ||
73 | 430 | self.addCleanup(self.keyboard.release, "Ctrl+Alt+Right") | ||
74 | 431 | sleep(1) | ||
75 | 432 | self.keybinding_hold_part_then_tap("switcher/reveal_normal") | ||
76 | 433 | self.addCleanup(self.switcher.terminate) | ||
77 | 434 | |||
78 | 435 | self.assertThat(self.switcher.visible, Eventually(Equals(False))) | ||
79 | 420 | 436 | ||
80 | === modified file 'unity-shared/PluginAdapter.h' | |||
81 | --- unity-shared/PluginAdapter.h 2012-05-07 00:49:31 +0000 | |||
82 | +++ unity-shared/PluginAdapter.h 2012-08-10 23:01:11 +0000 | |||
83 | @@ -92,11 +92,13 @@ | |||
84 | 92 | void OnLeaveDesktop (); | 92 | void OnLeaveDesktop (); |
85 | 93 | 93 | ||
86 | 94 | void TerminateScale(); | 94 | void TerminateScale(); |
89 | 95 | bool IsScaleActive(); | 95 | bool IsScaleActive() const; |
90 | 96 | bool IsScaleActiveForGroup(); | 96 | bool IsScaleActiveForGroup() const; |
91 | 97 | 97 | ||
92 | 98 | void InitiateExpo(); | 98 | void InitiateExpo(); |
94 | 99 | bool IsExpoActive(); | 99 | bool IsExpoActive() const; |
95 | 100 | |||
96 | 101 | bool IsWallActive() const; | ||
97 | 100 | 102 | ||
98 | 101 | void ShowGrabHandles(CompWindow* window, bool use_timer); | 103 | void ShowGrabHandles(CompWindow* window, bool use_timer); |
99 | 102 | void HideGrabHandles(CompWindow* window); | 104 | void HideGrabHandles(CompWindow* window); |
100 | @@ -109,22 +111,22 @@ | |||
101 | 109 | void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option); | 111 | void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option); |
102 | 110 | void NotifyNewDecorationState(guint32 xid); | 112 | void NotifyNewDecorationState(guint32 xid); |
103 | 111 | 113 | ||
105 | 112 | guint32 GetActiveWindow(); | 114 | guint32 GetActiveWindow() const; |
106 | 113 | 115 | ||
107 | 114 | void Decorate(guint32 xid); | 116 | void Decorate(guint32 xid); |
108 | 115 | void Undecorate(guint32 xid); | 117 | void Undecorate(guint32 xid); |
109 | 116 | 118 | ||
110 | 117 | // WindowManager implementation | 119 | // WindowManager implementation |
112 | 118 | bool IsWindowMaximized(guint xid); | 120 | bool IsWindowMaximized(guint xid) const; |
113 | 119 | bool IsWindowDecorated(guint xid); | 121 | bool IsWindowDecorated(guint xid); |
122 | 120 | bool IsWindowOnCurrentDesktop(guint xid); | 122 | bool IsWindowOnCurrentDesktop(guint xid) const; |
123 | 121 | bool IsWindowObscured(guint xid); | 123 | bool IsWindowObscured(guint xid) const; |
124 | 122 | bool IsWindowMapped(guint xid); | 124 | bool IsWindowMapped(guint xid) const; |
125 | 123 | bool IsWindowVisible(guint32 xid); | 125 | bool IsWindowVisible(guint32 xid) const; |
126 | 124 | bool IsWindowOnTop(guint32 xid); | 126 | bool IsWindowOnTop(guint32 xid) const; |
127 | 125 | bool IsWindowClosable(guint32 xid); | 127 | bool IsWindowClosable(guint32 xid) const; |
128 | 126 | bool IsWindowMinimizable(guint32 xid); | 128 | bool IsWindowMinimizable(guint32 xid) const; |
129 | 127 | bool IsWindowMaximizable(guint32 xid); | 129 | bool IsWindowMaximizable(guint32 xid) const; |
130 | 128 | 130 | ||
131 | 129 | void Restore(guint32 xid); | 131 | void Restore(guint32 xid); |
132 | 130 | void RestoreAt(guint32 xid, int x, int y); | 132 | void RestoreAt(guint32 xid, int x, int y); |
133 | @@ -140,12 +142,12 @@ | |||
134 | 140 | void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true); | 142 | void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true); |
135 | 141 | bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force); | 143 | bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force); |
136 | 142 | 144 | ||
143 | 143 | bool IsScreenGrabbed(); | 145 | bool IsScreenGrabbed() const; |
144 | 144 | bool IsViewPortSwitchStarted(); | 146 | bool IsViewPortSwitchStarted() const; |
145 | 145 | 147 | ||
146 | 146 | unsigned long long GetWindowActiveNumber (guint32 xid); | 148 | unsigned long long GetWindowActiveNumber (guint32 xid) const; |
147 | 147 | 149 | ||
148 | 148 | bool MaximizeIfBigEnough(CompWindow* window); | 150 | bool MaximizeIfBigEnough(CompWindow* window) const; |
149 | 149 | 151 | ||
150 | 150 | int GetWindowMonitor(guint32 xid) const; | 152 | int GetWindowMonitor(guint32 xid) const; |
151 | 151 | nux::Geometry GetWindowGeometry(guint32 xid) const; | 153 | nux::Geometry GetWindowGeometry(guint32 xid) const; |
152 | @@ -155,7 +157,7 @@ | |||
153 | 155 | 157 | ||
154 | 156 | void CheckWindowIntersections(nux::Geometry const& region, bool &active, bool &any); | 158 | void CheckWindowIntersections(nux::Geometry const& region, bool &active, bool &any); |
155 | 157 | 159 | ||
157 | 158 | int WorkspaceCount(); | 160 | int WorkspaceCount() const; |
158 | 159 | 161 | ||
159 | 160 | void SetCoverageAreaBeforeAutomaximize(float area); | 162 | void SetCoverageAreaBeforeAutomaximize(float area); |
160 | 161 | 163 | ||
161 | @@ -172,7 +174,7 @@ | |||
162 | 172 | std::string MatchStringForXids(std::vector<Window> *windows); | 174 | std::string MatchStringForXids(std::vector<Window> *windows); |
163 | 173 | void InitiateScale(std::string const& match, int state = 0); | 175 | void InitiateScale(std::string const& match, int state = 0); |
164 | 174 | 176 | ||
166 | 175 | bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window); | 177 | bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const; |
167 | 176 | void SetMwmWindowHints(Window xid, MotifWmHints* new_hints); | 178 | void SetMwmWindowHints(Window xid, MotifWmHints* new_hints); |
168 | 177 | 179 | ||
169 | 178 | CompScreen* m_Screen; | 180 | CompScreen* m_Screen; |
170 | 179 | 181 | ||
171 | === modified file 'unity-shared/PluginAdapterCompiz.cpp' | |||
172 | --- unity-shared/PluginAdapterCompiz.cpp 2012-07-30 16:47:33 +0000 | |||
173 | +++ unity-shared/PluginAdapterCompiz.cpp 2012-08-10 23:01:11 +0000 | |||
174 | @@ -298,7 +298,7 @@ | |||
175 | 298 | } | 298 | } |
176 | 299 | 299 | ||
177 | 300 | unsigned long long | 300 | unsigned long long |
179 | 301 | PluginAdapter::GetWindowActiveNumber (guint32 xid) | 301 | PluginAdapter::GetWindowActiveNumber (guint32 xid) const |
180 | 302 | { | 302 | { |
181 | 303 | Window win = xid; | 303 | Window win = xid; |
182 | 304 | CompWindow* window; | 304 | CompWindow* window; |
183 | @@ -368,23 +368,29 @@ | |||
184 | 368 | } | 368 | } |
185 | 369 | 369 | ||
186 | 370 | bool | 370 | bool |
188 | 371 | PluginAdapter::IsScaleActive() | 371 | PluginAdapter::IsScaleActive() const |
189 | 372 | { | 372 | { |
190 | 373 | return m_Screen->grabExist("scale"); | 373 | return m_Screen->grabExist("scale"); |
191 | 374 | } | 374 | } |
192 | 375 | 375 | ||
193 | 376 | bool | 376 | bool |
195 | 377 | PluginAdapter::IsScaleActiveForGroup() | 377 | PluginAdapter::IsScaleActiveForGroup() const |
196 | 378 | { | 378 | { |
197 | 379 | return _spread_windows_state && m_Screen->grabExist("scale"); | 379 | return _spread_windows_state && m_Screen->grabExist("scale"); |
198 | 380 | } | 380 | } |
199 | 381 | 381 | ||
200 | 382 | bool | 382 | bool |
202 | 383 | PluginAdapter::IsExpoActive() | 383 | PluginAdapter::IsExpoActive() const |
203 | 384 | { | 384 | { |
204 | 385 | return m_Screen->grabExist("expo"); | 385 | return m_Screen->grabExist("expo"); |
205 | 386 | } | 386 | } |
206 | 387 | 387 | ||
207 | 388 | bool | ||
208 | 389 | PluginAdapter::IsWallActive() const | ||
209 | 390 | { | ||
210 | 391 | return m_Screen->grabExist("wall"); | ||
211 | 392 | } | ||
212 | 393 | |||
213 | 388 | void | 394 | void |
214 | 389 | PluginAdapter::InitiateExpo() | 395 | PluginAdapter::InitiateExpo() |
215 | 390 | { | 396 | { |
216 | @@ -395,13 +401,13 @@ | |||
217 | 395 | 401 | ||
218 | 396 | // WindowManager implementation | 402 | // WindowManager implementation |
219 | 397 | guint32 | 403 | guint32 |
221 | 398 | PluginAdapter::GetActiveWindow() | 404 | PluginAdapter::GetActiveWindow() const |
222 | 399 | { | 405 | { |
223 | 400 | return m_Screen->activeWindow(); | 406 | return m_Screen->activeWindow(); |
224 | 401 | } | 407 | } |
225 | 402 | 408 | ||
226 | 403 | bool | 409 | bool |
228 | 404 | PluginAdapter::IsWindowMaximized(guint xid) | 410 | PluginAdapter::IsWindowMaximized(guint xid) const |
229 | 405 | { | 411 | { |
230 | 406 | Window win = xid; | 412 | Window win = xid; |
231 | 407 | CompWindow* window; | 413 | CompWindow* window; |
232 | @@ -456,7 +462,7 @@ | |||
233 | 456 | } | 462 | } |
234 | 457 | 463 | ||
235 | 458 | bool | 464 | bool |
237 | 459 | PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) | 465 | PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const |
238 | 460 | { | 466 | { |
239 | 461 | Window win = xid; | 467 | Window win = xid; |
240 | 462 | CompWindow* window; | 468 | CompWindow* window; |
241 | @@ -472,7 +478,7 @@ | |||
242 | 472 | } | 478 | } |
243 | 473 | 479 | ||
244 | 474 | bool | 480 | bool |
246 | 475 | PluginAdapter::IsWindowObscured(guint32 xid) | 481 | PluginAdapter::IsWindowObscured(guint32 xid) const |
247 | 476 | { | 482 | { |
248 | 477 | Window win = xid; | 483 | Window win = xid; |
249 | 478 | CompWindow* window; | 484 | CompWindow* window; |
250 | @@ -505,7 +511,7 @@ | |||
251 | 505 | } | 511 | } |
252 | 506 | 512 | ||
253 | 507 | bool | 513 | bool |
255 | 508 | PluginAdapter::IsWindowMapped(guint32 xid) | 514 | PluginAdapter::IsWindowMapped(guint32 xid) const |
256 | 509 | { | 515 | { |
257 | 510 | Window win = xid; | 516 | Window win = xid; |
258 | 511 | CompWindow* window; | 517 | CompWindow* window; |
259 | @@ -517,7 +523,7 @@ | |||
260 | 517 | } | 523 | } |
261 | 518 | 524 | ||
262 | 519 | bool | 525 | bool |
264 | 520 | PluginAdapter::IsWindowVisible(guint32 xid) | 526 | PluginAdapter::IsWindowVisible(guint32 xid) const |
265 | 521 | { | 527 | { |
266 | 522 | Window win = xid; | 528 | Window win = xid; |
267 | 523 | CompWindow* window; | 529 | CompWindow* window; |
268 | @@ -530,7 +536,7 @@ | |||
269 | 530 | } | 536 | } |
270 | 531 | 537 | ||
271 | 532 | bool | 538 | bool |
273 | 533 | PluginAdapter::IsWindowOnTop(guint32 xid) | 539 | PluginAdapter::IsWindowOnTop(guint32 xid) const |
274 | 534 | { | 540 | { |
275 | 535 | Window win = xid; | 541 | Window win = xid; |
276 | 536 | CompWindow* window = m_Screen->findWindow(win); | 542 | CompWindow* window = m_Screen->findWindow(win); |
277 | @@ -569,7 +575,7 @@ | |||
278 | 569 | } | 575 | } |
279 | 570 | 576 | ||
280 | 571 | bool | 577 | bool |
282 | 572 | PluginAdapter::IsWindowClosable(guint32 xid) | 578 | PluginAdapter::IsWindowClosable(guint32 xid) const |
283 | 573 | { | 579 | { |
284 | 574 | Window win = xid; | 580 | Window win = xid; |
285 | 575 | CompWindow* window; | 581 | CompWindow* window; |
286 | @@ -582,7 +588,7 @@ | |||
287 | 582 | } | 588 | } |
288 | 583 | 589 | ||
289 | 584 | bool | 590 | bool |
291 | 585 | PluginAdapter::IsWindowMinimizable(guint32 xid) | 591 | PluginAdapter::IsWindowMinimizable(guint32 xid) const |
292 | 586 | { | 592 | { |
293 | 587 | Window win = xid; | 593 | Window win = xid; |
294 | 588 | CompWindow* window; | 594 | CompWindow* window; |
295 | @@ -595,7 +601,7 @@ | |||
296 | 595 | } | 601 | } |
297 | 596 | 602 | ||
298 | 597 | bool | 603 | bool |
300 | 598 | PluginAdapter::IsWindowMaximizable(guint32 xid) | 604 | PluginAdapter::IsWindowMaximizable(guint32 xid) const |
301 | 599 | { | 605 | { |
302 | 600 | Window win = xid; | 606 | Window win = xid; |
303 | 601 | CompWindow* window; | 607 | CompWindow* window; |
304 | @@ -965,7 +971,7 @@ | |||
305 | 965 | } | 971 | } |
306 | 966 | 972 | ||
307 | 967 | bool | 973 | bool |
309 | 968 | PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) | 974 | PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const |
310 | 969 | { | 975 | { |
311 | 970 | int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask | | 976 | int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask | |
312 | 971 | CompWindowTypeModalDialogMask | CompWindowTypeUtilMask; | 977 | CompWindowTypeModalDialogMask | CompWindowTypeUtilMask; |
313 | @@ -1022,7 +1028,7 @@ | |||
314 | 1022 | } | 1028 | } |
315 | 1023 | 1029 | ||
316 | 1024 | int | 1030 | int |
318 | 1025 | PluginAdapter::WorkspaceCount() | 1031 | PluginAdapter::WorkspaceCount() const |
319 | 1026 | { | 1032 | { |
320 | 1027 | return m_Screen->vpSize().width() * m_Screen->vpSize().height(); | 1033 | return m_Screen->vpSize().width() * m_Screen->vpSize().height(); |
321 | 1028 | } | 1034 | } |
322 | @@ -1105,19 +1111,19 @@ | |||
323 | 1105 | } | 1111 | } |
324 | 1106 | 1112 | ||
325 | 1107 | bool | 1113 | bool |
327 | 1108 | PluginAdapter::IsScreenGrabbed() | 1114 | PluginAdapter::IsScreenGrabbed() const |
328 | 1109 | { | 1115 | { |
329 | 1110 | return m_Screen->grabbed(); | 1116 | return m_Screen->grabbed(); |
330 | 1111 | } | 1117 | } |
331 | 1112 | 1118 | ||
332 | 1113 | bool | 1119 | bool |
334 | 1114 | PluginAdapter::IsViewPortSwitchStarted() | 1120 | PluginAdapter::IsViewPortSwitchStarted() const |
335 | 1115 | { | 1121 | { |
336 | 1116 | return _vp_switch_started; | 1122 | return _vp_switch_started; |
337 | 1117 | } | 1123 | } |
338 | 1118 | 1124 | ||
339 | 1119 | /* Returns true if the window was maximized */ | 1125 | /* Returns true if the window was maximized */ |
341 | 1120 | bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) | 1126 | bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const |
342 | 1121 | { | 1127 | { |
343 | 1122 | XClassHint classHint; | 1128 | XClassHint classHint; |
344 | 1123 | Status status; | 1129 | Status status; |
345 | 1124 | 1130 | ||
346 | === modified file 'unity-shared/PluginAdapterStandalone.cpp' | |||
347 | --- unity-shared/PluginAdapterStandalone.cpp 2012-07-16 18:43:20 +0000 | |||
348 | +++ unity-shared/PluginAdapterStandalone.cpp 2012-08-10 23:01:11 +0000 | |||
349 | @@ -125,7 +125,7 @@ | |||
350 | 125 | } | 125 | } |
351 | 126 | 126 | ||
352 | 127 | unsigned long long | 127 | unsigned long long |
354 | 128 | PluginAdapter::GetWindowActiveNumber (guint32 xid) | 128 | PluginAdapter::GetWindowActiveNumber (guint32 xid) const |
355 | 129 | { | 129 | { |
356 | 130 | return 0; | 130 | return 0; |
357 | 131 | } | 131 | } |
358 | @@ -157,19 +157,19 @@ | |||
359 | 157 | } | 157 | } |
360 | 158 | 158 | ||
361 | 159 | bool | 159 | bool |
375 | 160 | PluginAdapter::IsScaleActive() | 160 | PluginAdapter::IsScaleActive() const |
376 | 161 | { | 161 | { |
377 | 162 | return false; | 162 | return false; |
378 | 163 | } | 163 | } |
379 | 164 | 164 | ||
380 | 165 | bool | 165 | bool |
381 | 166 | PluginAdapter::IsScaleActiveForGroup() | 166 | PluginAdapter::IsScaleActiveForGroup() const |
382 | 167 | { | 167 | { |
383 | 168 | return false; | 168 | return false; |
384 | 169 | } | 169 | } |
385 | 170 | 170 | ||
386 | 171 | bool | 171 | bool |
387 | 172 | PluginAdapter::IsExpoActive() | 172 | PluginAdapter::IsExpoActive() const |
388 | 173 | { | 173 | { |
389 | 174 | return false; | 174 | return false; |
390 | 175 | } | 175 | } |
391 | @@ -179,15 +179,21 @@ | |||
392 | 179 | { | 179 | { |
393 | 180 | } | 180 | } |
394 | 181 | 181 | ||
395 | 182 | bool | ||
396 | 183 | PluginAdapter::IsWallActive() const | ||
397 | 184 | { | ||
398 | 185 | return false; | ||
399 | 186 | } | ||
400 | 187 | |||
401 | 182 | // WindowManager implementation | 188 | // WindowManager implementation |
402 | 183 | guint32 | 189 | guint32 |
404 | 184 | PluginAdapter::GetActiveWindow() | 190 | PluginAdapter::GetActiveWindow() const |
405 | 185 | { | 191 | { |
406 | 186 | return 0; | 192 | return 0; |
407 | 187 | } | 193 | } |
408 | 188 | 194 | ||
409 | 189 | bool | 195 | bool |
411 | 190 | PluginAdapter::IsWindowMaximized(guint xid) | 196 | PluginAdapter::IsWindowMaximized(guint xid) const |
412 | 191 | { | 197 | { |
413 | 192 | return false; | 198 | return false; |
414 | 193 | } | 199 | } |
415 | @@ -199,49 +205,49 @@ | |||
416 | 199 | } | 205 | } |
417 | 200 | 206 | ||
418 | 201 | bool | 207 | bool |
462 | 202 | PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) | 208 | PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const |
463 | 203 | { | 209 | { |
464 | 204 | return false; | 210 | return false; |
465 | 205 | } | 211 | } |
466 | 206 | 212 | ||
467 | 207 | bool | 213 | bool |
468 | 208 | PluginAdapter::IsWindowObscured(guint32 xid) | 214 | PluginAdapter::IsWindowObscured(guint32 xid) const |
469 | 209 | { | 215 | { |
470 | 210 | return false; | 216 | return false; |
471 | 211 | } | 217 | } |
472 | 212 | 218 | ||
473 | 213 | bool | 219 | bool |
474 | 214 | PluginAdapter::IsWindowMapped(guint32 xid) | 220 | PluginAdapter::IsWindowMapped(guint32 xid) const |
475 | 215 | { | 221 | { |
476 | 216 | return false; | 222 | return false; |
477 | 217 | } | 223 | } |
478 | 218 | 224 | ||
479 | 219 | bool | 225 | bool |
480 | 220 | PluginAdapter::IsWindowVisible(guint32 xid) | 226 | PluginAdapter::IsWindowVisible(guint32 xid) const |
481 | 221 | { | 227 | { |
482 | 222 | return false; | 228 | return false; |
483 | 223 | } | 229 | } |
484 | 224 | 230 | ||
485 | 225 | bool | 231 | bool |
486 | 226 | PluginAdapter::IsWindowOnTop(guint32 xid) | 232 | PluginAdapter::IsWindowOnTop(guint32 xid) const |
487 | 227 | { | 233 | { |
488 | 228 | return false; | 234 | return false; |
489 | 229 | } | 235 | } |
490 | 230 | 236 | ||
491 | 231 | bool | 237 | bool |
492 | 232 | PluginAdapter::IsWindowClosable(guint32 xid) | 238 | PluginAdapter::IsWindowClosable(guint32 xid) const |
493 | 233 | { | 239 | { |
494 | 234 | return false; | 240 | return false; |
495 | 235 | } | 241 | } |
496 | 236 | 242 | ||
497 | 237 | bool | 243 | bool |
498 | 238 | PluginAdapter::IsWindowMinimizable(guint32 xid) | 244 | PluginAdapter::IsWindowMinimizable(guint32 xid) const |
499 | 239 | { | 245 | { |
500 | 240 | return false; | 246 | return false; |
501 | 241 | } | 247 | } |
502 | 242 | 248 | ||
503 | 243 | bool | 249 | bool |
504 | 244 | PluginAdapter::IsWindowMaximizable(guint32 xid) | 250 | PluginAdapter::IsWindowMaximizable(guint32 xid) const |
505 | 245 | { | 251 | { |
506 | 246 | return false; | 252 | return false; |
507 | 247 | } | 253 | } |
508 | @@ -347,7 +353,7 @@ | |||
509 | 347 | } | 353 | } |
510 | 348 | 354 | ||
511 | 349 | bool | 355 | bool |
513 | 350 | PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) | 356 | PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const |
514 | 351 | { | 357 | { |
515 | 352 | return false; | 358 | return false; |
516 | 353 | } | 359 | } |
517 | @@ -358,7 +364,7 @@ | |||
518 | 358 | } | 364 | } |
519 | 359 | 365 | ||
520 | 360 | int | 366 | int |
522 | 361 | PluginAdapter::WorkspaceCount() | 367 | PluginAdapter::WorkspaceCount() const |
523 | 362 | { | 368 | { |
524 | 363 | return 4; | 369 | return 4; |
525 | 364 | } | 370 | } |
526 | @@ -379,19 +385,19 @@ | |||
527 | 379 | } | 385 | } |
528 | 380 | 386 | ||
529 | 381 | bool | 387 | bool |
531 | 382 | PluginAdapter::IsScreenGrabbed() | 388 | PluginAdapter::IsScreenGrabbed() const |
532 | 383 | { | 389 | { |
533 | 384 | return false; | 390 | return false; |
534 | 385 | } | 391 | } |
535 | 386 | 392 | ||
536 | 387 | bool | 393 | bool |
538 | 388 | PluginAdapter::IsViewPortSwitchStarted() | 394 | PluginAdapter::IsViewPortSwitchStarted() const |
539 | 389 | { | 395 | { |
540 | 390 | return false; | 396 | return false; |
541 | 391 | } | 397 | } |
542 | 392 | 398 | ||
543 | 393 | /* Returns true if the window was maximized */ | 399 | /* Returns true if the window was maximized */ |
545 | 394 | bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) | 400 | bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const |
546 | 395 | { | 401 | { |
547 | 396 | return true; | 402 | return true; |
548 | 397 | } | 403 | } |
549 | 398 | 404 | ||
550 | === modified file 'unity-shared/WindowManager.cpp' | |||
551 | --- unity-shared/WindowManager.cpp 2012-06-18 02:57:23 +0000 | |||
552 | +++ unity-shared/WindowManager.cpp 2012-08-10 23:01:11 +0000 | |||
553 | @@ -23,22 +23,22 @@ | |||
554 | 23 | 23 | ||
555 | 24 | class WindowManagerDummy : public WindowManager | 24 | class WindowManagerDummy : public WindowManager |
556 | 25 | { | 25 | { |
568 | 26 | guint32 GetActiveWindow() | 26 | guint32 GetActiveWindow() const |
569 | 27 | { | 27 | { |
570 | 28 | return 0; | 28 | return 0; |
571 | 29 | } | 29 | } |
572 | 30 | 30 | ||
573 | 31 | unsigned long long GetWindowActiveNumber (guint32 xid) | 31 | unsigned long long GetWindowActiveNumber (guint32 xid) const |
574 | 32 | { | 32 | { |
575 | 33 | return 0; | 33 | return 0; |
576 | 34 | } | 34 | } |
577 | 35 | 35 | ||
578 | 36 | bool IsScreenGrabbed() | 36 | bool IsScreenGrabbed() const |
579 | 37 | { | 37 | { |
580 | 38 | return false; | 38 | return false; |
581 | 39 | } | 39 | } |
582 | 40 | 40 | ||
584 | 41 | bool IsViewPortSwitchStarted() | 41 | bool IsViewPortSwitchStarted() const |
585 | 42 | { | 42 | { |
586 | 43 | return false; | 43 | return false; |
587 | 44 | } | 44 | } |
588 | @@ -48,7 +48,7 @@ | |||
589 | 48 | g_debug("%s", G_STRFUNC); | 48 | g_debug("%s", G_STRFUNC); |
590 | 49 | } | 49 | } |
591 | 50 | 50 | ||
593 | 51 | bool IsWindowMaximized(guint32 xid) | 51 | bool IsWindowMaximized(guint32 xid) const |
594 | 52 | { | 52 | { |
595 | 53 | return false; | 53 | return false; |
596 | 54 | } | 54 | } |
597 | @@ -58,42 +58,42 @@ | |||
598 | 58 | return true; | 58 | return true; |
599 | 59 | } | 59 | } |
600 | 60 | 60 | ||
637 | 61 | bool IsWindowOnCurrentDesktop(guint32 xid) | 61 | bool IsWindowOnCurrentDesktop(guint32 xid) const |
638 | 62 | { | 62 | { |
639 | 63 | return true; | 63 | return true; |
640 | 64 | } | 64 | } |
641 | 65 | 65 | ||
642 | 66 | bool IsWindowObscured(guint32 xid) | 66 | bool IsWindowObscured(guint32 xid) const |
643 | 67 | { | 67 | { |
644 | 68 | return false; | 68 | return false; |
645 | 69 | } | 69 | } |
646 | 70 | 70 | ||
647 | 71 | bool IsWindowMapped(guint32 xid) | 71 | bool IsWindowMapped(guint32 xid) const |
648 | 72 | { | 72 | { |
649 | 73 | return true; | 73 | return true; |
650 | 74 | } | 74 | } |
651 | 75 | 75 | ||
652 | 76 | bool IsWindowVisible(guint32 xid) | 76 | bool IsWindowVisible(guint32 xid) const |
653 | 77 | { | 77 | { |
654 | 78 | return true; | 78 | return true; |
655 | 79 | } | 79 | } |
656 | 80 | 80 | ||
657 | 81 | bool IsWindowOnTop(guint32 xid) | 81 | bool IsWindowOnTop(guint32 xid) const |
658 | 82 | { | 82 | { |
659 | 83 | return false; | 83 | return false; |
660 | 84 | } | 84 | } |
661 | 85 | 85 | ||
662 | 86 | bool IsWindowClosable(guint32 xid) | 86 | bool IsWindowClosable(guint32 xid) const |
663 | 87 | { | 87 | { |
664 | 88 | return true; | 88 | return true; |
665 | 89 | } | 89 | } |
666 | 90 | 90 | ||
667 | 91 | bool IsWindowMinimizable(guint32 xid) | 91 | bool IsWindowMinimizable(guint32 xid) const |
668 | 92 | { | 92 | { |
669 | 93 | return true; | 93 | return true; |
670 | 94 | } | 94 | } |
671 | 95 | 95 | ||
672 | 96 | bool IsWindowMaximizable(guint32 xid) | 96 | bool IsWindowMaximizable(guint32 xid) const |
673 | 97 | { | 97 | { |
674 | 98 | return true; | 98 | return true; |
675 | 99 | } | 99 | } |
676 | @@ -182,7 +182,7 @@ | |||
677 | 182 | any = false; | 182 | any = false; |
678 | 183 | } | 183 | } |
679 | 184 | 184 | ||
681 | 185 | int WorkspaceCount () | 185 | int WorkspaceCount () const |
682 | 186 | { | 186 | { |
683 | 187 | return 1; | 187 | return 1; |
684 | 188 | } | 188 | } |
685 | @@ -192,13 +192,13 @@ | |||
686 | 192 | g_debug("%s", G_STRFUNC); | 192 | g_debug("%s", G_STRFUNC); |
687 | 193 | } | 193 | } |
688 | 194 | 194 | ||
690 | 195 | bool IsScaleActive() | 195 | bool IsScaleActive() const |
691 | 196 | { | 196 | { |
692 | 197 | g_debug("%s", G_STRFUNC); | 197 | g_debug("%s", G_STRFUNC); |
693 | 198 | return false; | 198 | return false; |
694 | 199 | } | 199 | } |
695 | 200 | 200 | ||
697 | 201 | bool IsScaleActiveForGroup() | 201 | bool IsScaleActiveForGroup() const |
698 | 202 | { | 202 | { |
699 | 203 | g_debug("%s", G_STRFUNC); | 203 | g_debug("%s", G_STRFUNC); |
700 | 204 | return false; | 204 | return false; |
701 | @@ -209,7 +209,13 @@ | |||
702 | 209 | g_debug("%s", G_STRFUNC); | 209 | g_debug("%s", G_STRFUNC); |
703 | 210 | } | 210 | } |
704 | 211 | 211 | ||
706 | 212 | bool IsExpoActive() | 212 | bool IsExpoActive() const |
707 | 213 | { | ||
708 | 214 | g_debug("%s", G_STRFUNC); | ||
709 | 215 | return false; | ||
710 | 216 | } | ||
711 | 217 | |||
712 | 218 | bool IsWallActive() const | ||
713 | 213 | { | 219 | { |
714 | 214 | g_debug("%s", G_STRFUNC); | 220 | g_debug("%s", G_STRFUNC); |
715 | 215 | return false; | 221 | return false; |
716 | 216 | 222 | ||
717 | === modified file 'unity-shared/WindowManager.h' | |||
718 | --- unity-shared/WindowManager.h 2012-06-18 02:57:23 +0000 | |||
719 | +++ unity-shared/WindowManager.h 2012-08-10 23:01:11 +0000 | |||
720 | @@ -49,18 +49,18 @@ | |||
721 | 49 | static WindowManager* Default(); | 49 | static WindowManager* Default(); |
722 | 50 | static void SetDefault(WindowManager* manager); | 50 | static void SetDefault(WindowManager* manager); |
723 | 51 | 51 | ||
725 | 52 | virtual guint32 GetActiveWindow() = 0; | 52 | virtual guint32 GetActiveWindow() const = 0; |
726 | 53 | 53 | ||
728 | 54 | virtual bool IsWindowMaximized(guint32 xid) = 0; | 54 | virtual bool IsWindowMaximized(guint32 xid) const = 0; |
729 | 55 | virtual bool IsWindowDecorated(guint32 xid) = 0; | 55 | virtual bool IsWindowDecorated(guint32 xid) = 0; |
738 | 56 | virtual bool IsWindowOnCurrentDesktop(guint32 xid) = 0; | 56 | virtual bool IsWindowOnCurrentDesktop(guint32 xid) const = 0; |
739 | 57 | virtual bool IsWindowObscured(guint32 xid) = 0; | 57 | virtual bool IsWindowObscured(guint32 xid) const = 0; |
740 | 58 | virtual bool IsWindowMapped(guint32 xid) = 0; | 58 | virtual bool IsWindowMapped(guint32 xid) const = 0; |
741 | 59 | virtual bool IsWindowVisible(guint32 xid) = 0; | 59 | virtual bool IsWindowVisible(guint32 xid) const = 0; |
742 | 60 | virtual bool IsWindowOnTop(guint32 xid) = 0; | 60 | virtual bool IsWindowOnTop(guint32 xid) const = 0; |
743 | 61 | virtual bool IsWindowClosable(guint32 xid) = 0; | 61 | virtual bool IsWindowClosable(guint32 xid) const = 0; |
744 | 62 | virtual bool IsWindowMinimizable(guint32 xid) = 0; | 62 | virtual bool IsWindowMinimizable(guint32 xid) const = 0; |
745 | 63 | virtual bool IsWindowMaximizable(guint32 xid) = 0; | 63 | virtual bool IsWindowMaximizable(guint32 xid) const = 0; |
746 | 64 | 64 | ||
747 | 65 | virtual void ShowDesktop() = 0; | 65 | virtual void ShowDesktop() = 0; |
748 | 66 | 66 | ||
749 | @@ -74,11 +74,13 @@ | |||
750 | 74 | virtual void Lower(guint32 xid) = 0; | 74 | virtual void Lower(guint32 xid) = 0; |
751 | 75 | 75 | ||
752 | 76 | virtual void TerminateScale() = 0; | 76 | virtual void TerminateScale() = 0; |
755 | 77 | virtual bool IsScaleActive() = 0; | 77 | virtual bool IsScaleActive() const = 0; |
756 | 78 | virtual bool IsScaleActiveForGroup() = 0; | 78 | virtual bool IsScaleActiveForGroup() const = 0; |
757 | 79 | 79 | ||
758 | 80 | virtual void InitiateExpo() = 0; | 80 | virtual void InitiateExpo() = 0; |
760 | 81 | virtual bool IsExpoActive() = 0; | 81 | virtual bool IsExpoActive() const = 0; |
761 | 82 | |||
762 | 83 | virtual bool IsWallActive() const = 0; | ||
763 | 82 | 84 | ||
764 | 83 | virtual void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true) = 0; | 85 | virtual void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true) = 0; |
765 | 84 | virtual bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force) = 0; | 86 | virtual bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force) = 0; |
766 | @@ -86,8 +88,8 @@ | |||
767 | 86 | virtual void Decorate(guint32 xid) {}; | 88 | virtual void Decorate(guint32 xid) {}; |
768 | 87 | virtual void Undecorate(guint32 xid) {}; | 89 | virtual void Undecorate(guint32 xid) {}; |
769 | 88 | 90 | ||
772 | 89 | virtual bool IsScreenGrabbed() = 0; | 91 | virtual bool IsScreenGrabbed() const = 0; |
773 | 90 | virtual bool IsViewPortSwitchStarted() = 0; | 92 | virtual bool IsViewPortSwitchStarted() const = 0; |
774 | 91 | 93 | ||
775 | 92 | virtual void MoveResizeWindow(guint32 xid, nux::Geometry geometry) = 0; | 94 | virtual void MoveResizeWindow(guint32 xid, nux::Geometry geometry) = 0; |
776 | 93 | void StartMove(guint32 xid, int, int); | 95 | void StartMove(guint32 xid, int, int); |
777 | @@ -98,13 +100,13 @@ | |||
778 | 98 | virtual nux::Geometry GetScreenGeometry() const = 0; | 100 | virtual nux::Geometry GetScreenGeometry() const = 0; |
779 | 99 | virtual nux::Geometry GetWorkAreaGeometry(guint32 xid = 0) const = 0; | 101 | virtual nux::Geometry GetWorkAreaGeometry(guint32 xid = 0) const = 0; |
780 | 100 | 102 | ||
782 | 101 | virtual unsigned long long GetWindowActiveNumber(guint32 xid) = 0; | 103 | virtual unsigned long long GetWindowActiveNumber(guint32 xid) const = 0; |
783 | 102 | 104 | ||
784 | 103 | virtual void SetWindowIconGeometry(Window window, nux::Geometry const& geo) = 0; | 105 | virtual void SetWindowIconGeometry(Window window, nux::Geometry const& geo) = 0; |
785 | 104 | 106 | ||
786 | 105 | virtual void CheckWindowIntersections (nux::Geometry const& region, bool &active, bool &any) = 0; | 107 | virtual void CheckWindowIntersections (nux::Geometry const& region, bool &active, bool &any) = 0; |
787 | 106 | 108 | ||
789 | 107 | virtual int WorkspaceCount() = 0; | 109 | virtual int WorkspaceCount() const = 0; |
790 | 108 | 110 | ||
791 | 109 | virtual bool saveInputFocus() = 0; | 111 | virtual bool saveInputFocus() = 0; |
792 | 110 | virtual bool restoreInputFocus() = 0; | 112 | virtual bool restoreInputFocus() = 0; |
Hi,
10 + return (!(results.size() == 1 && 0]->GetIconType () == AbstractLaunche rIcon:: IconType: :TYPE_DESKTOP) && :Default( )->IsWallActive () &&
11 + results[
12 + !WindowManager:
13 + !results.empty());
Can we please change this to be a bit more sane? First of all, you're checking both "results.size() == 1" and then later checking "!results.empty()". If the first is true, the second will always be true. I'm also not a fn of multi-line code that requires you to write "(!(".
71 + self.workspace. switch_ to(0) press(" Ctrl+Alt+ Right") _hold_part_ then_tap( "switcher/ reveal_ normal" ) (self.switcher. terminate) release( "Ctrl+Alt" )
72 + sleep(1)
73 + self.keyboard.
74 + sleep(1)
75 + self.keybinding
76 + self.addCleanup
77 + self.keyboard.
This will leave keys in a pressed state. Please add cleanup actions to release the Ctrl+Alt+Right keys.
Other than that, looks good!