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

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3395
Proposed branch: lp:~townsend/unity/fix-panel-shadow-regressions
Merge into: lp:unity
Diff against target: 59 lines (+19/-8)
1 file modified
plugins/unityshell/src/unityshell.cpp (+19/-8)
To merge this branch: bzr merge lp:~townsend/unity/fix-panel-shadow-regressions
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+171855@code.launchpad.net

Commit message

Fixes some panel shadow regressions caused by rev. 3381.
- No panel shadow when logging in, ie, no windows are opened.
- Indicator drop down menus have the panel shadow painted over them.
- Notification bubbles cause the panel shadow to be drawn on top of everything.
- Minimizing all windows caused the panel shadow to not be drawn.

Description of the change

== Issue ==
The changes I introduced in revno. 3381 has caused some panel shadow regressions. These include:

1. No panel shadow when logging in, ie, no windows are opened.
2. Indicator drop down menus have the panel shadow painted over them.
3. Notification bubbles cause the panel shadow to be drawn on top of everything.
4. Minimizing all windows caused the panel shadow to not be drawn.

== Fix ==
1. Check if the "desktop window" is the top window and draw the panel shadow if it is.
2. In the GetTopVisibleWindow() function also check:
   a. If the window is not minimized.
   b. If the window resName is not empty.
   c. If the window resName is not "unity-panel-service".
   d. If the window resName is not "notify-osd".

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
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-06-27 10:16:04 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-06-27 16:27:29 +0000
4@@ -960,7 +960,11 @@
5
6 for (CompWindow *w : screen->windows ())
7 {
8- if (w->isViewable())
9+ if (w->isViewable() &&
10+ !w->minimized() &&
11+ !w->resName().empty() &&
12+ (w->resName() != "unity-panel-service") &&
13+ (w->resName() != "notify-osd"))
14 {
15 top_visible_window = w;
16 }
17@@ -2611,12 +2615,22 @@
18 {
19 Window active_window = screen->activeWindow();
20
21+ CompWindow *top_visible_window;
22+
23 if (G_UNLIKELY(window->type() == CompWindowTypeDesktopMask))
24 {
25 uScreen->setPanelShadowMatrix(matrix);
26
27 if (active_window == 0 || active_window == window->id())
28+ {
29+ top_visible_window = GetTopVisibleWindow();
30+
31+ if (top_visible_window && (window->id() == top_visible_window->id()))
32+ {
33+ draw_panel_shadow = DrawPanelShadow::OVER_WINDOW;
34+ }
35 uScreen->is_desktop_active_ = true;
36+ }
37 }
38 else
39 {
40@@ -2641,15 +2655,12 @@
41 {
42 if (uScreen->is_desktop_active_)
43 {
44- CompWindow *top_visible_window = GetTopVisibleWindow();
45+ top_visible_window = GetTopVisibleWindow();
46
47- if (top_visible_window)
48+ if (top_visible_window && (window->id() == top_visible_window->id()))
49 {
50- if (window->id() == top_visible_window->id())
51- {
52- draw_panel_shadow = DrawPanelShadow::OVER_WINDOW;
53- uScreen->panelShadowPainted = CompRegion();
54- }
55+ draw_panel_shadow = DrawPanelShadow::OVER_WINDOW;
56+ uScreen->panelShadowPainted = CompRegion();
57 }
58 }
59 }