Merge lp:~brandontschaefer/unity/disable-switcher-when-wall-active into lp:unity

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
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 :

Hi,

10 + return (!(results.size() == 1 &&
11 + results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP) &&
12 + !WindowManager::Default()->IsWallActive() &&
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)
72 + sleep(1)
73 + self.keyboard.press("Ctrl+Alt+Right")
74 + sleep(1)
75 + self.keybinding_hold_part_then_tap("switcher/reveal_normal")
76 + self.addCleanup(self.switcher.terminate)
77 + self.keyboard.release("Ctrl+Alt")

This will leave keys in a pressed state. Please add cleanup actions to release the Ctrl+Alt+Right keys.

Other than that, looks good!

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/unityshell/src/unityshell.cpp
text conflict in tests/autopilot/unity/tests/test_switcher.py

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/SwitcherController.cpp'
--- launcher/SwitcherController.cpp 2012-08-10 09:58:49 +0000
+++ launcher/SwitcherController.cpp 2012-08-10 23:01:11 +0000
@@ -70,6 +70,13 @@
70 view_->background_color = bg_color_;70 view_->background_color = bg_color_;
71}71}
7272
73bool Controller::CanShowSwitcher(const std::vector<AbstractLauncherIcon::Ptr>& results) const
74{
75 bool empty = (show_desktop_disabled_ ? results.empty() : results.size() == 1);
76
77 return (!empty && !WindowManager::Default()->IsWallActive());
78}
79
73void Controller::Show(ShowMode show, SortMode sort, bool reverse,80void Controller::Show(ShowMode show, SortMode sort, bool reverse,
74 std::vector<AbstractLauncherIcon::Ptr> results)81 std::vector<AbstractLauncherIcon::Ptr> results)
75{82{
7683
=== modified file 'launcher/SwitcherController.h'
--- launcher/SwitcherController.h 2012-07-27 01:06:27 +0000
+++ launcher/SwitcherController.h 2012-08-10 23:01:11 +0000
@@ -70,6 +70,8 @@
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);
71 void Hide(bool accept_state=true);71 void Hide(bool accept_state=true);
7272
73 bool CanShowSwitcher(const std::vector<launcher::AbstractLauncherIcon::Ptr>& resutls) const;
74
73 bool Visible();75 bool Visible();
7476
75 void Next();77 void Next();
7678
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-08-10 09:58:49 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-08-10 23:01:11 +0000
@@ -1895,7 +1895,7 @@
1895 auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT,1895 auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT,
1896 switcher_controller_->IsShowDesktopDisabled());1896 switcher_controller_->IsShowDesktopDisabled());
18971897
1898 if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::DESKTOP) && !results.empty())1898 if (switcher_controller_->CanShowSwitcher(results))
1899 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);1899 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
19001900
1901 return true;1901 return true;
@@ -1949,7 +1949,9 @@
1949 CompAction::State state,1949 CompAction::State state,
1950 CompOption::Vector& options)1950 CompOption::Vector& options)
1951{1951{
1952 if (switcher_controller_->Visible())1952 if (WindowManager::Default()->IsWallActive())
1953 return false;
1954 else if (switcher_controller_->Visible())
1953 switcher_controller_->Next();1955 switcher_controller_->Next();
1954 else1956 else
1955 altTabInitiateCommon(action, switcher::ShowMode::ALL);1957 altTabInitiateCommon(action, switcher::ShowMode::ALL);
19561958
=== modified file 'tests/autopilot/unity/tests/test_switcher.py'
--- tests/autopilot/unity/tests/test_switcher.py 2012-08-09 01:37:02 +0000
+++ tests/autopilot/unity/tests/test_switcher.py 2012-08-10 23:01:11 +0000
@@ -417,3 +417,19 @@
417 self.switcher.select()417 self.switcher.select()
418418
419 self.assertProperty(char_win2, is_hidden=False)419 self.assertProperty(char_win2, is_hidden=False)
420
421 def test_switcher_is_disabled_when_wall_plugin_active(self):
422 """The switcher must not open when the wall plugin is active using ctrl+alt+<direction>."""
423
424 initial_workspace = self.workspace.current_workspace
425 self.addCleanup(self.workspace.switch_to, initial_workspace)
426
427 self.workspace.switch_to(0)
428 sleep(1)
429 self.keyboard.press("Ctrl+Alt+Right")
430 self.addCleanup(self.keyboard.release, "Ctrl+Alt+Right")
431 sleep(1)
432 self.keybinding_hold_part_then_tap("switcher/reveal_normal")
433 self.addCleanup(self.switcher.terminate)
434
435 self.assertThat(self.switcher.visible, Eventually(Equals(False)))
420436
=== modified file 'unity-shared/PluginAdapter.h'
--- unity-shared/PluginAdapter.h 2012-05-07 00:49:31 +0000
+++ unity-shared/PluginAdapter.h 2012-08-10 23:01:11 +0000
@@ -92,11 +92,13 @@
92 void OnLeaveDesktop ();92 void OnLeaveDesktop ();
9393
94 void TerminateScale();94 void TerminateScale();
95 bool IsScaleActive();95 bool IsScaleActive() const;
96 bool IsScaleActiveForGroup();96 bool IsScaleActiveForGroup() const;
9797
98 void InitiateExpo();98 void InitiateExpo();
99 bool IsExpoActive();99 bool IsExpoActive() const;
100
101 bool IsWallActive() const;
100102
101 void ShowGrabHandles(CompWindow* window, bool use_timer);103 void ShowGrabHandles(CompWindow* window, bool use_timer);
102 void HideGrabHandles(CompWindow* window);104 void HideGrabHandles(CompWindow* window);
@@ -109,22 +111,22 @@
109 void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option);111 void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option);
110 void NotifyNewDecorationState(guint32 xid);112 void NotifyNewDecorationState(guint32 xid);
111113
112 guint32 GetActiveWindow();114 guint32 GetActiveWindow() const;
113115
114 void Decorate(guint32 xid);116 void Decorate(guint32 xid);
115 void Undecorate(guint32 xid);117 void Undecorate(guint32 xid);
116118
117 // WindowManager implementation119 // WindowManager implementation
118 bool IsWindowMaximized(guint xid);120 bool IsWindowMaximized(guint xid) const;
119 bool IsWindowDecorated(guint xid);121 bool IsWindowDecorated(guint xid);
120 bool IsWindowOnCurrentDesktop(guint xid);122 bool IsWindowOnCurrentDesktop(guint xid) const;
121 bool IsWindowObscured(guint xid);123 bool IsWindowObscured(guint xid) const;
122 bool IsWindowMapped(guint xid);124 bool IsWindowMapped(guint xid) const;
123 bool IsWindowVisible(guint32 xid);125 bool IsWindowVisible(guint32 xid) const;
124 bool IsWindowOnTop(guint32 xid);126 bool IsWindowOnTop(guint32 xid) const;
125 bool IsWindowClosable(guint32 xid);127 bool IsWindowClosable(guint32 xid) const;
126 bool IsWindowMinimizable(guint32 xid);128 bool IsWindowMinimizable(guint32 xid) const;
127 bool IsWindowMaximizable(guint32 xid);129 bool IsWindowMaximizable(guint32 xid) const;
128130
129 void Restore(guint32 xid);131 void Restore(guint32 xid);
130 void RestoreAt(guint32 xid, int x, int y);132 void RestoreAt(guint32 xid, int x, int y);
@@ -140,12 +142,12 @@
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);
141 bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force);143 bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force);
142144
143 bool IsScreenGrabbed();145 bool IsScreenGrabbed() const;
144 bool IsViewPortSwitchStarted();146 bool IsViewPortSwitchStarted() const;
145147
146 unsigned long long GetWindowActiveNumber (guint32 xid);148 unsigned long long GetWindowActiveNumber (guint32 xid) const;
147149
148 bool MaximizeIfBigEnough(CompWindow* window);150 bool MaximizeIfBigEnough(CompWindow* window) const;
149151
150 int GetWindowMonitor(guint32 xid) const;152 int GetWindowMonitor(guint32 xid) const;
151 nux::Geometry GetWindowGeometry(guint32 xid) const;153 nux::Geometry GetWindowGeometry(guint32 xid) const;
@@ -155,7 +157,7 @@
155157
156 void CheckWindowIntersections(nux::Geometry const& region, bool &active, bool &any);158 void CheckWindowIntersections(nux::Geometry const& region, bool &active, bool &any);
157159
158 int WorkspaceCount();160 int WorkspaceCount() const;
159161
160 void SetCoverageAreaBeforeAutomaximize(float area);162 void SetCoverageAreaBeforeAutomaximize(float area);
161163
@@ -172,7 +174,7 @@
172 std::string MatchStringForXids(std::vector<Window> *windows);174 std::string MatchStringForXids(std::vector<Window> *windows);
173 void InitiateScale(std::string const& match, int state = 0);175 void InitiateScale(std::string const& match, int state = 0);
174176
175 bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window);177 bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const;
176 void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);178 void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);
177179
178 CompScreen* m_Screen;180 CompScreen* m_Screen;
179181
=== modified file 'unity-shared/PluginAdapterCompiz.cpp'
--- unity-shared/PluginAdapterCompiz.cpp 2012-07-30 16:47:33 +0000
+++ unity-shared/PluginAdapterCompiz.cpp 2012-08-10 23:01:11 +0000
@@ -298,7 +298,7 @@
298}298}
299299
300unsigned long long300unsigned long long
301PluginAdapter::GetWindowActiveNumber (guint32 xid)301PluginAdapter::GetWindowActiveNumber (guint32 xid) const
302{302{
303 Window win = xid;303 Window win = xid;
304 CompWindow* window;304 CompWindow* window;
@@ -368,23 +368,29 @@
368}368}
369369
370bool370bool
371PluginAdapter::IsScaleActive()371PluginAdapter::IsScaleActive() const
372{372{
373 return m_Screen->grabExist("scale");373 return m_Screen->grabExist("scale");
374}374}
375375
376bool376bool
377PluginAdapter::IsScaleActiveForGroup()377PluginAdapter::IsScaleActiveForGroup() const
378{378{
379 return _spread_windows_state && m_Screen->grabExist("scale");379 return _spread_windows_state && m_Screen->grabExist("scale");
380}380}
381381
382bool382bool
383PluginAdapter::IsExpoActive()383PluginAdapter::IsExpoActive() const
384{384{
385 return m_Screen->grabExist("expo");385 return m_Screen->grabExist("expo");
386}386}
387387
388bool
389PluginAdapter::IsWallActive() const
390{
391 return m_Screen->grabExist("wall");
392}
393
388void394void
389PluginAdapter::InitiateExpo()395PluginAdapter::InitiateExpo()
390{396{
@@ -395,13 +401,13 @@
395401
396// WindowManager implementation402// WindowManager implementation
397guint32403guint32
398PluginAdapter::GetActiveWindow()404PluginAdapter::GetActiveWindow() const
399{405{
400 return m_Screen->activeWindow();406 return m_Screen->activeWindow();
401}407}
402408
403bool409bool
404PluginAdapter::IsWindowMaximized(guint xid)410PluginAdapter::IsWindowMaximized(guint xid) const
405{411{
406 Window win = xid;412 Window win = xid;
407 CompWindow* window;413 CompWindow* window;
@@ -456,7 +462,7 @@
456}462}
457463
458bool464bool
459PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)465PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const
460{466{
461 Window win = xid;467 Window win = xid;
462 CompWindow* window;468 CompWindow* window;
@@ -472,7 +478,7 @@
472}478}
473479
474bool480bool
475PluginAdapter::IsWindowObscured(guint32 xid)481PluginAdapter::IsWindowObscured(guint32 xid) const
476{482{
477 Window win = xid;483 Window win = xid;
478 CompWindow* window;484 CompWindow* window;
@@ -505,7 +511,7 @@
505}511}
506512
507bool513bool
508PluginAdapter::IsWindowMapped(guint32 xid)514PluginAdapter::IsWindowMapped(guint32 xid) const
509{515{
510 Window win = xid;516 Window win = xid;
511 CompWindow* window;517 CompWindow* window;
@@ -517,7 +523,7 @@
517}523}
518524
519bool525bool
520PluginAdapter::IsWindowVisible(guint32 xid)526PluginAdapter::IsWindowVisible(guint32 xid) const
521{527{
522 Window win = xid;528 Window win = xid;
523 CompWindow* window;529 CompWindow* window;
@@ -530,7 +536,7 @@
530}536}
531537
532bool538bool
533PluginAdapter::IsWindowOnTop(guint32 xid)539PluginAdapter::IsWindowOnTop(guint32 xid) const
534{540{
535 Window win = xid;541 Window win = xid;
536 CompWindow* window = m_Screen->findWindow(win);542 CompWindow* window = m_Screen->findWindow(win);
@@ -569,7 +575,7 @@
569}575}
570576
571bool577bool
572PluginAdapter::IsWindowClosable(guint32 xid)578PluginAdapter::IsWindowClosable(guint32 xid) const
573{579{
574 Window win = xid;580 Window win = xid;
575 CompWindow* window;581 CompWindow* window;
@@ -582,7 +588,7 @@
582}588}
583589
584bool590bool
585PluginAdapter::IsWindowMinimizable(guint32 xid)591PluginAdapter::IsWindowMinimizable(guint32 xid) const
586{592{
587 Window win = xid;593 Window win = xid;
588 CompWindow* window;594 CompWindow* window;
@@ -595,7 +601,7 @@
595}601}
596602
597bool603bool
598PluginAdapter::IsWindowMaximizable(guint32 xid)604PluginAdapter::IsWindowMaximizable(guint32 xid) const
599{605{
600 Window win = xid;606 Window win = xid;
601 CompWindow* window;607 CompWindow* window;
@@ -965,7 +971,7 @@
965}971}
966972
967bool973bool
968PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window)974PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const
969{975{
970 int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask |976 int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask |
971 CompWindowTypeModalDialogMask | CompWindowTypeUtilMask;977 CompWindowTypeModalDialogMask | CompWindowTypeUtilMask;
@@ -1022,7 +1028,7 @@
1022}1028}
10231029
1024int1030int
1025PluginAdapter::WorkspaceCount()1031PluginAdapter::WorkspaceCount() const
1026{1032{
1027 return m_Screen->vpSize().width() * m_Screen->vpSize().height();1033 return m_Screen->vpSize().width() * m_Screen->vpSize().height();
1028}1034}
@@ -1105,19 +1111,19 @@
1105}1111}
11061112
1107bool1113bool
1108PluginAdapter::IsScreenGrabbed()1114PluginAdapter::IsScreenGrabbed() const
1109{1115{
1110 return m_Screen->grabbed();1116 return m_Screen->grabbed();
1111}1117}
11121118
1113bool1119bool
1114PluginAdapter::IsViewPortSwitchStarted()1120PluginAdapter::IsViewPortSwitchStarted() const
1115{1121{
1116 return _vp_switch_started;1122 return _vp_switch_started;
1117}1123}
11181124
1119/* Returns true if the window was maximized */1125/* Returns true if the window was maximized */
1120bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window)1126bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const
1121{1127{
1122 XClassHint classHint;1128 XClassHint classHint;
1123 Status status;1129 Status status;
11241130
=== modified file 'unity-shared/PluginAdapterStandalone.cpp'
--- unity-shared/PluginAdapterStandalone.cpp 2012-07-16 18:43:20 +0000
+++ unity-shared/PluginAdapterStandalone.cpp 2012-08-10 23:01:11 +0000
@@ -125,7 +125,7 @@
125}125}
126126
127unsigned long long127unsigned long long
128PluginAdapter::GetWindowActiveNumber (guint32 xid)128PluginAdapter::GetWindowActiveNumber (guint32 xid) const
129{129{
130 return 0;130 return 0;
131}131}
@@ -157,19 +157,19 @@
157}157}
158158
159bool159bool
160PluginAdapter::IsScaleActive()160PluginAdapter::IsScaleActive() const
161{161{
162 return false;162 return false;
163}163}
164164
165bool165bool
166PluginAdapter::IsScaleActiveForGroup()166PluginAdapter::IsScaleActiveForGroup() const
167{167{
168 return false;168 return false;
169}169}
170170
171bool171bool
172PluginAdapter::IsExpoActive()172PluginAdapter::IsExpoActive() const
173{173{
174 return false;174 return false;
175}175}
@@ -179,15 +179,21 @@
179{179{
180}180}
181181
182bool
183PluginAdapter::IsWallActive() const
184{
185 return false;
186}
187
182// WindowManager implementation188// WindowManager implementation
183guint32189guint32
184PluginAdapter::GetActiveWindow()190PluginAdapter::GetActiveWindow() const
185{191{
186 return 0;192 return 0;
187}193}
188194
189bool195bool
190PluginAdapter::IsWindowMaximized(guint xid)196PluginAdapter::IsWindowMaximized(guint xid) const
191{197{
192 return false;198 return false;
193}199}
@@ -199,49 +205,49 @@
199}205}
200206
201bool207bool
202PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)208PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const
203{209{
204 return false;210 return false;
205}211}
206212
207bool213bool
208PluginAdapter::IsWindowObscured(guint32 xid)214PluginAdapter::IsWindowObscured(guint32 xid) const
209{215{
210 return false;216 return false;
211}217}
212218
213bool219bool
214PluginAdapter::IsWindowMapped(guint32 xid)220PluginAdapter::IsWindowMapped(guint32 xid) const
215{221{
216 return false;222 return false;
217}223}
218224
219bool225bool
220PluginAdapter::IsWindowVisible(guint32 xid)226PluginAdapter::IsWindowVisible(guint32 xid) const
221{227{
222 return false;228 return false;
223}229}
224230
225bool231bool
226PluginAdapter::IsWindowOnTop(guint32 xid)232PluginAdapter::IsWindowOnTop(guint32 xid) const
227{233{
228 return false;234 return false;
229}235}
230236
231bool237bool
232PluginAdapter::IsWindowClosable(guint32 xid)238PluginAdapter::IsWindowClosable(guint32 xid) const
233{239{
234 return false;240 return false;
235}241}
236242
237bool243bool
238PluginAdapter::IsWindowMinimizable(guint32 xid)244PluginAdapter::IsWindowMinimizable(guint32 xid) const
239{245{
240 return false;246 return false;
241}247}
242248
243bool249bool
244PluginAdapter::IsWindowMaximizable(guint32 xid)250PluginAdapter::IsWindowMaximizable(guint32 xid) const
245{251{
246 return false;252 return false;
247}253}
@@ -347,7 +353,7 @@
347}353}
348354
349bool355bool
350PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window)356PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const
351{357{
352 return false;358 return false;
353}359}
@@ -358,7 +364,7 @@
358}364}
359365
360int366int
361PluginAdapter::WorkspaceCount()367PluginAdapter::WorkspaceCount() const
362{368{
363 return 4;369 return 4;
364}370}
@@ -379,19 +385,19 @@
379}385}
380386
381bool387bool
382PluginAdapter::IsScreenGrabbed()388PluginAdapter::IsScreenGrabbed() const
383{389{
384 return false;390 return false;
385}391}
386392
387bool393bool
388PluginAdapter::IsViewPortSwitchStarted()394PluginAdapter::IsViewPortSwitchStarted() const
389{395{
390 return false;396 return false;
391}397}
392398
393/* Returns true if the window was maximized */399/* Returns true if the window was maximized */
394bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window)400bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const
395{401{
396 return true;402 return true;
397}403}
398404
=== modified file 'unity-shared/WindowManager.cpp'
--- unity-shared/WindowManager.cpp 2012-06-18 02:57:23 +0000
+++ unity-shared/WindowManager.cpp 2012-08-10 23:01:11 +0000
@@ -23,22 +23,22 @@
2323
24class WindowManagerDummy : public WindowManager24class WindowManagerDummy : public WindowManager
25{25{
26 guint32 GetActiveWindow()26 guint32 GetActiveWindow() const
27 {27 {
28 return 0;28 return 0;
29 }29 }
3030
31 unsigned long long GetWindowActiveNumber (guint32 xid)31 unsigned long long GetWindowActiveNumber (guint32 xid) const
32 {32 {
33 return 0;33 return 0;
34 }34 }
3535
36 bool IsScreenGrabbed()36 bool IsScreenGrabbed() const
37 {37 {
38 return false;38 return false;
39 }39 }
4040
41 bool IsViewPortSwitchStarted()41 bool IsViewPortSwitchStarted() const
42 {42 {
43 return false;43 return false;
44 }44 }
@@ -48,7 +48,7 @@
48 g_debug("%s", G_STRFUNC);48 g_debug("%s", G_STRFUNC);
49 }49 }
5050
51 bool IsWindowMaximized(guint32 xid)51 bool IsWindowMaximized(guint32 xid) const
52 {52 {
53 return false;53 return false;
54 }54 }
@@ -58,42 +58,42 @@
58 return true;58 return true;
59 }59 }
6060
61 bool IsWindowOnCurrentDesktop(guint32 xid)61 bool IsWindowOnCurrentDesktop(guint32 xid) const
62 {62 {
63 return true;63 return true;
64 }64 }
6565
66 bool IsWindowObscured(guint32 xid)66 bool IsWindowObscured(guint32 xid) const
67 {67 {
68 return false;68 return false;
69 }69 }
7070
71 bool IsWindowMapped(guint32 xid)71 bool IsWindowMapped(guint32 xid) const
72 {72 {
73 return true;73 return true;
74 }74 }
7575
76 bool IsWindowVisible(guint32 xid)76 bool IsWindowVisible(guint32 xid) const
77 {77 {
78 return true;78 return true;
79 }79 }
8080
81 bool IsWindowOnTop(guint32 xid)81 bool IsWindowOnTop(guint32 xid) const
82 {82 {
83 return false;83 return false;
84 }84 }
8585
86 bool IsWindowClosable(guint32 xid)86 bool IsWindowClosable(guint32 xid) const
87 {87 {
88 return true;88 return true;
89 }89 }
9090
91 bool IsWindowMinimizable(guint32 xid)91 bool IsWindowMinimizable(guint32 xid) const
92 {92 {
93 return true;93 return true;
94 }94 }
9595
96 bool IsWindowMaximizable(guint32 xid)96 bool IsWindowMaximizable(guint32 xid) const
97 {97 {
98 return true;98 return true;
99 }99 }
@@ -182,7 +182,7 @@
182 any = false;182 any = false;
183 }183 }
184184
185 int WorkspaceCount ()185 int WorkspaceCount () const
186 {186 {
187 return 1;187 return 1;
188 }188 }
@@ -192,13 +192,13 @@
192 g_debug("%s", G_STRFUNC);192 g_debug("%s", G_STRFUNC);
193 }193 }
194194
195 bool IsScaleActive()195 bool IsScaleActive() const
196 {196 {
197 g_debug("%s", G_STRFUNC);197 g_debug("%s", G_STRFUNC);
198 return false;198 return false;
199 }199 }
200200
201 bool IsScaleActiveForGroup()201 bool IsScaleActiveForGroup() const
202 {202 {
203 g_debug("%s", G_STRFUNC);203 g_debug("%s", G_STRFUNC);
204 return false;204 return false;
@@ -209,7 +209,13 @@
209 g_debug("%s", G_STRFUNC);209 g_debug("%s", G_STRFUNC);
210 }210 }
211211
212 bool IsExpoActive()212 bool IsExpoActive() const
213 {
214 g_debug("%s", G_STRFUNC);
215 return false;
216 }
217
218 bool IsWallActive() const
213 {219 {
214 g_debug("%s", G_STRFUNC);220 g_debug("%s", G_STRFUNC);
215 return false;221 return false;
216222
=== modified file 'unity-shared/WindowManager.h'
--- unity-shared/WindowManager.h 2012-06-18 02:57:23 +0000
+++ unity-shared/WindowManager.h 2012-08-10 23:01:11 +0000
@@ -49,18 +49,18 @@
49 static WindowManager* Default();49 static WindowManager* Default();
50 static void SetDefault(WindowManager* manager);50 static void SetDefault(WindowManager* manager);
5151
52 virtual guint32 GetActiveWindow() = 0;52 virtual guint32 GetActiveWindow() const = 0;
5353
54 virtual bool IsWindowMaximized(guint32 xid) = 0;54 virtual bool IsWindowMaximized(guint32 xid) const = 0;
55 virtual bool IsWindowDecorated(guint32 xid) = 0;55 virtual bool IsWindowDecorated(guint32 xid) = 0;
56 virtual bool IsWindowOnCurrentDesktop(guint32 xid) = 0;56 virtual bool IsWindowOnCurrentDesktop(guint32 xid) const = 0;
57 virtual bool IsWindowObscured(guint32 xid) = 0;57 virtual bool IsWindowObscured(guint32 xid) const = 0;
58 virtual bool IsWindowMapped(guint32 xid) = 0;58 virtual bool IsWindowMapped(guint32 xid) const = 0;
59 virtual bool IsWindowVisible(guint32 xid) = 0;59 virtual bool IsWindowVisible(guint32 xid) const = 0;
60 virtual bool IsWindowOnTop(guint32 xid) = 0;60 virtual bool IsWindowOnTop(guint32 xid) const = 0;
61 virtual bool IsWindowClosable(guint32 xid) = 0;61 virtual bool IsWindowClosable(guint32 xid) const = 0;
62 virtual bool IsWindowMinimizable(guint32 xid) = 0;62 virtual bool IsWindowMinimizable(guint32 xid) const = 0;
63 virtual bool IsWindowMaximizable(guint32 xid) = 0;63 virtual bool IsWindowMaximizable(guint32 xid) const = 0;
6464
65 virtual void ShowDesktop() = 0;65 virtual void ShowDesktop() = 0;
6666
@@ -74,11 +74,13 @@
74 virtual void Lower(guint32 xid) = 0;74 virtual void Lower(guint32 xid) = 0;
7575
76 virtual void TerminateScale() = 0;76 virtual void TerminateScale() = 0;
77 virtual bool IsScaleActive() = 0;77 virtual bool IsScaleActive() const = 0;
78 virtual bool IsScaleActiveForGroup() = 0;78 virtual bool IsScaleActiveForGroup() const = 0;
7979
80 virtual void InitiateExpo() = 0;80 virtual void InitiateExpo() = 0;
81 virtual bool IsExpoActive() = 0;81 virtual bool IsExpoActive() const = 0;
82
83 virtual bool IsWallActive() const = 0;
8284
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;
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;
@@ -86,8 +88,8 @@
86 virtual void Decorate(guint32 xid) {};88 virtual void Decorate(guint32 xid) {};
87 virtual void Undecorate(guint32 xid) {};89 virtual void Undecorate(guint32 xid) {};
8890
89 virtual bool IsScreenGrabbed() = 0;91 virtual bool IsScreenGrabbed() const = 0;
90 virtual bool IsViewPortSwitchStarted() = 0;92 virtual bool IsViewPortSwitchStarted() const = 0;
9193
92 virtual void MoveResizeWindow(guint32 xid, nux::Geometry geometry) = 0;94 virtual void MoveResizeWindow(guint32 xid, nux::Geometry geometry) = 0;
93 void StartMove(guint32 xid, int, int);95 void StartMove(guint32 xid, int, int);
@@ -98,13 +100,13 @@
98 virtual nux::Geometry GetScreenGeometry() const = 0;100 virtual nux::Geometry GetScreenGeometry() const = 0;
99 virtual nux::Geometry GetWorkAreaGeometry(guint32 xid = 0) const = 0;101 virtual nux::Geometry GetWorkAreaGeometry(guint32 xid = 0) const = 0;
100102
101 virtual unsigned long long GetWindowActiveNumber(guint32 xid) = 0;103 virtual unsigned long long GetWindowActiveNumber(guint32 xid) const = 0;
102104
103 virtual void SetWindowIconGeometry(Window window, nux::Geometry const& geo) = 0;105 virtual void SetWindowIconGeometry(Window window, nux::Geometry const& geo) = 0;
104106
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;
106108
107 virtual int WorkspaceCount() = 0;109 virtual int WorkspaceCount() const = 0;
108110
109 virtual bool saveInputFocus() = 0;111 virtual bool saveInputFocus() = 0;
110 virtual bool restoreInputFocus() = 0;112 virtual bool restoreInputFocus() = 0;