Merge lp:~sil2100/unity/revert_r3380_showdesktop into lp:unity

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 3386
Proposed branch: lp:~sil2100/unity/revert_r3380_showdesktop
Merge into: lp:unity
Diff against target: 143 lines (+3/-50)
3 files modified
plugins/unityshell/src/unityshell.cpp (+3/-24)
unity-shared/PluginAdapter.cpp (+0/-24)
unity-shared/PluginAdapter.h (+0/-2)
To merge this branch: bzr merge lp:~sil2100/unity/revert_r3380_showdesktop
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Azzarone (community) Approve
Review via email: mp+171781@code.launchpad.net

Commit message

Revert revision 3380. This caused regression of all autopilot tests as show_desktop was invalidly detected every time there are no visible windows on screen

Description of the change

- Problem:

Autopilot tests are failing because of unity invalidly informing about show_desktop mode.

- Fix:

Revert revision 3380. Those changes broke the show_desktop info mechanism. I think that the fix in overall is a bit hm, broken.

- Tests:

N/A

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) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2013-06-22 02:15:40 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-06-27 12:04:40 +0000
4@@ -858,11 +858,9 @@
5 {
6 for (CompWindow *w : screen->windows ())
7 {
8- CompPoint const& viewport = w->defaultViewport();
9 UnityWindow *uw = UnityWindow::get (w);
10
11- if (viewport == uScreen->screen->vp() &&
12- ShowdesktopHandler::ShouldHide (static_cast <ShowdesktopHandlerWindowInterface *> (uw)))
13+ if (ShowdesktopHandler::ShouldHide (static_cast <ShowdesktopHandlerWindowInterface *> (uw)))
14 {
15 UnityWindow::get (w)->enterShowDesktop ();
16 // the animation plugin does strange things here ...
17@@ -903,10 +901,7 @@
18 {
19 for (CompWindow *cw : screen->windows ())
20 {
21- CompPoint const& viewport = cw->defaultViewport();
22-
23- if (viewport == uScreen->screen->vp() &&
24- cw->inShowDesktopMode ())
25+ if (cw->inShowDesktopMode ())
26 {
27 UnityWindow::get (cw)->leaveShowDesktop ();
28 // the animation plugin does strange things here ...
29@@ -917,17 +912,7 @@
30
31 PluginAdapter::Default().OnLeaveDesktop();
32
33- if (w)
34- {
35- CompPoint const& viewport = w->defaultViewport();
36-
37- if (viewport == uScreen->screen->vp())
38- screen->leaveShowDesktopMode (w);
39- }
40- else
41- {
42- screen->focusDefaultWindow();
43- }
44+ screen->leaveShowDesktopMode (w);
45 }
46 else
47 {
48@@ -1008,8 +993,6 @@
49 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());
50 window->activate ();
51 ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ());
52-
53- PluginAdapter::Default().OnLeaveDesktop();
54 }
55
56 void UnityWindow::DoEnableFocus ()
57@@ -2831,8 +2814,6 @@
58 window->unminimizeSetEnabled (this, false);
59 window->minimizedSetEnabled (this, false);
60 }
61-
62- PluginAdapter::Default().UpdateShowDesktopState();
63 break;
64 case CompWindowNotifyBeforeDestroy:
65 being_destroyed.emit();
66@@ -3447,8 +3428,6 @@
67 GLWindowInterface::setHandler(gWindow);
68 ScaleWindowInterface::setHandler (ScaleWindow::get (window));
69
70- PluginAdapter::Default().OnLeaveDesktop();
71-
72 /* This needs to happen before we set our wrapable functions, since we
73 * need to ask core (and not ourselves) whether or not the window is
74 * minimized */
75
76=== modified file 'unity-shared/PluginAdapter.cpp'
77--- unity-shared/PluginAdapter.cpp 2013-06-20 19:44:33 +0000
78+++ unity-shared/PluginAdapter.cpp 2013-06-27 12:04:40 +0000
79@@ -217,8 +217,6 @@
80 }
81 else if (g_strcmp0(event, "end_viewport_switch") == 0)
82 {
83- UpdateShowDesktopState();
84-
85 _vp_switch_started = false;
86 screen_viewport_switch_ended.emit();
87 }
88@@ -612,20 +610,6 @@
89 return 0;
90 }
91
92-bool PluginAdapter::IsCurrentViewportEmpty() const
93-{
94- Window win = GetTopMostValidWindowInViewport();
95-
96- if (win)
97- {
98- CompWindow* cwin = m_Screen->findWindow(win);
99- if (!(cwin->type() & NO_FOCUS_MASK))
100- return false;
101- }
102-
103- return true;
104-}
105-
106 Window PluginAdapter::GetTopWindowAbove(Window xid) const
107 {
108 CompWindow* window;
109@@ -946,14 +930,6 @@
110 _in_show_desktop = false;
111 }
112
113-void PluginAdapter::UpdateShowDesktopState()
114-{
115- if (!IsCurrentViewportEmpty())
116- OnLeaveDesktop();
117- else
118- OnShowDesktop();
119-}
120-
121 int PluginAdapter::GetWindowMonitor(Window window_id) const
122 {
123 // FIXME, we should use window->outputDevice() but this is not UScreen friendly
124
125=== modified file 'unity-shared/PluginAdapter.h'
126--- unity-shared/PluginAdapter.h 2013-06-20 19:44:33 +0000
127+++ unity-shared/PluginAdapter.h 2013-06-27 12:04:40 +0000
128@@ -97,7 +97,6 @@
129
130 void OnShowDesktop ();
131 void OnLeaveDesktop ();
132- void UpdateShowDesktopState();
133
134 void TerminateScale();
135 bool IsScaleActive() const;
136@@ -207,7 +206,6 @@
137 unsigned long GetMwnDecorations(Window xid) const;
138
139 Window GetTopMostValidWindowInViewport() const;
140- bool IsCurrentViewportEmpty() const;
141
142 std::string GetTextProperty(Window xid, Atom atom) const;
143 std::string GetUtf8Property(Window xid, Atom atom) const;