Merge lp:~townsend/unity/fix-no-desktop-panel-shadow into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3454
Proposed branch: lp:~townsend/unity/fix-no-desktop-panel-shadow
Merge into: lp:unity
Diff against target: 71 lines (+2/-29)
2 files modified
plugins/unityshell/src/unityshell.cpp (+2/-27)
plugins/unityshell/src/unityshell.h (+0/-2)
To merge this branch: bzr merge lp:~townsend/unity/fix-no-desktop-panel-shadow
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marco Trevisan (Treviño) Approve
Brandon Schaefer (community) Approve
Review via email: mp+176387@code.launchpad.net

Commit message

Fix yet another regression in revno. 3381 where the Panel shadow is not drawn when in Show Desktop mode by using PluginAdapter::IsWindowOnTop() instead of the new GetTopVisibleWindow(). Remove GetTopVisibleWindow() to get rid of code duplication.

Description of the change

= Issue =
Yet another regression from the work done in rev. 3381 has been found where the Panel shadow is not drawn when in Show Desktop mode.

= Fix =
Use PluginAdapter::IsWindowOnTop() instead of the GetTopVisibleWindow() I wrote for the original bug. Removed GetTopVisibleWindow() for get rid of code duplication.

= Test =
Visual only, so a manual test is needed. Enter Show Desktop by any of the means available and observe that the Panel shadow is now drawn.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks fine... Looking at the branch merged on 3381, you added a function to get top window... That's fine, Just one thing wasn't PluginAdapter::GetTopMostValidWindowInViewport good for that case?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

I can't reproduce the bug. Do I need something special?

Revision history for this message
Christopher Townsend (townsend) wrote :

@andyrock

The way I reproduce this is to have some windows open and then Super-Ctrl-D and observe that the Panel shadow is not there. I just confirmed this still happens on my updated Saucy machine.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

While im not able to reproduce the bug, this is a great clean up as is anyway. LGTM

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (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-07-19 17:37:10 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-07-26 15:02:27 +0000
4@@ -969,25 +969,6 @@
5 return false;
6 }
7
8-CompWindow * GetTopVisibleWindow()
9-{
10- CompWindow *top_visible_window = NULL;
11-
12- for (CompWindow *w : screen->windows ())
13- {
14- if (w->isViewable() &&
15- !w->minimized() &&
16- !w->resName().empty() &&
17- (w->resName() != "unity-panel-service") &&
18- (w->resName() != "notify-osd"))
19- {
20- top_visible_window = w;
21- }
22- }
23-
24- return top_visible_window;
25-}
26-
27 void UnityWindow::enterShowDesktop ()
28 {
29 if (!mShowdesktopHandler)
30@@ -2632,17 +2613,13 @@
31 {
32 Window active_window = screen->activeWindow();
33
34- CompWindow *top_visible_window;
35-
36 if (G_UNLIKELY(window->type() == CompWindowTypeDesktopMask))
37 {
38 uScreen->setPanelShadowMatrix(matrix);
39
40 if (active_window == 0 || active_window == window->id())
41 {
42- top_visible_window = GetTopVisibleWindow();
43-
44- if (top_visible_window && (window->id() == top_visible_window->id()))
45+ if (PluginAdapter::Default().IsWindowOnTop(window->id()))
46 {
47 draw_panel_shadow = DrawPanelShadow::OVER_WINDOW;
48 }
49@@ -2672,9 +2649,7 @@
50 {
51 if (uScreen->is_desktop_active_)
52 {
53- top_visible_window = GetTopVisibleWindow();
54-
55- if (top_visible_window && (window->id() == top_visible_window->id()))
56+ if (PluginAdapter::Default().IsWindowOnTop(window->id()))
57 {
58 draw_panel_shadow = DrawPanelShadow::OVER_WINDOW;
59 uScreen->panelShadowPainted = CompRegion();
60
61=== modified file 'plugins/unityshell/src/unityshell.h'
62--- plugins/unityshell/src/unityshell.h 2013-07-19 17:37:10 +0000
63+++ plugins/unityshell/src/unityshell.h 2013-07-26 15:02:27 +0000
64@@ -250,8 +250,6 @@
65
66 void UpdateCloseWindowKey(CompAction::KeyBinding const&);
67
68- CompWindow * GetTopVisibleWindow();
69-
70 std::unique_ptr<na::TickSource> tick_source_;
71 std::unique_ptr<na::AnimationController> animation_controller_;
72