Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop Session

Bug #731685 reported by David Raid
44
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Undecided
Daniel van Vugt
Compiz Core
Fix Released
Undecided
Daniel van Vugt
compiz (Ubuntu)
Fix Released
Undecided
Daniel van Vugt

Bug Description

When logging in with the session 'Ubuntu Classic Desktop' (with the traditional gnome environment) there seems to be a problem with the panel shadows drawn by Compiz. When moving a window close to one of the panels, the shadows seem to cancel one another out. I've attached a screenshot to show what I mean.

Related branches

Revision history for this message
David Raid (davidraid) wrote :
Alex Launi (alexlauni)
Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Haikal Pribadi (haikalpribadi) wrote :

yes... finally.. been searching all over to look for this bug, but apparently it hasn't been solved yet. I have the exam same issue here. It's really annoying, but what can i say, the baby natty is still young. It would be the greatest thing if this is solved, for those who loves the new features of natty except for it's look and still prefer gnome.

Thanks guys...

Revision history for this message
Haikal Pribadi (haikalpribadi) wrote :

any leads on this issue, fellas?

Revision history for this message
Haikal Pribadi (haikalpribadi) wrote :

Helloo???

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Two screenshots are better than one...

A theory: I suspect the problem here is unity-window-decorator. It's designed to expect unity itself to draw the panel shadow (unityshell.cpp?), but in Ubuntu Classic mode compiz expects the traditional compiz window decorator to draw the panel shadow, but the unity-window-decorator doesn't (??)

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Re: [Bug 731685] Re: Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop Session

The problem is that the clipping algorithm for the shadows is rather
... simple. Basically when doing the panel shadow we look for windows
that are intersecting the shadow and don't draw the shadow there.

Fixing this would be quite complicated, since it requires that you
project the full geometry including the shape region of the decoration
in order to find a perfect intersection region.

On Wed, Jun 8, 2011 at 2:38 PM, Daniel van Vugt <email address hidden> wrote:
> Two screenshots are better than one...
>
> A theory: I suspect the problem here is unity-window-decorator. It's
> designed to expect unity itself to draw the panel shadow
> (unityshell.cpp?), but in Ubuntu Classic mode compiz expects the
> traditional compiz window decorator to draw the panel shadow, but the
> unity-window-decorator doesn't (??)
>
> ** Attachment added: "Screenshot.png"
>   https://bugs.launchpad.net/ubuntu/+source/unity/+bug/731685/+attachment/2160213/+files/Screenshot.png
>
> --
> You received this bug notification because you are a member of Unity
> Bugs, which is subscribed to unity in Ubuntu.
> https://bugs.launchpad.net/bugs/731685
>
> Title:
>  Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
>  Session
>
> Status in Compiz:
>  New
> Status in Unity:
>  Confirmed
> Status in “compiz” package in Ubuntu:
>  New
> Status in “unity” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  When logging in with the session 'Ubuntu Classic Desktop' (with the
>  traditional gnome environment) there seems to be a problem with the
>  panel shadows drawn by Compiz. When moving a window close to one of
>  the panels, the shadows seem to cancel one another out. I've attached
>  a screenshot to show what I mean.
>

--
Sam Spilsbury

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

On Wed, Jun 8, 2011 at 2:58 PM, Sam Spilsbury <email address hidden> wrote:
> The problem is that the clipping algorithm for the shadows is rather
> ... simple. Basically when doing the panel shadow we look for windows
> that are intersecting the shadow and don't draw the shadow there.

To clarify, this is because shadows are drawn at the same level that
their respective window is, so because we have to stack panels on top
of everything else, the shadow would also go on top of everything else
which looks ugly.

Drawing the shadow underneath everything else means that we
essentially have to paint panels twice, which isn't really that great.

>
> Fixing this would be quite complicated, since it requires that you
> project the full geometry including the shape region of the decoration
> in order to find a perfect intersection region.
>
> On Wed, Jun 8, 2011 at 2:38 PM, Daniel van Vugt <email address hidden> wrote:
>> Two screenshots are better than one...
>>
>> A theory: I suspect the problem here is unity-window-decorator. It's
>> designed to expect unity itself to draw the panel shadow
>> (unityshell.cpp?), but in Ubuntu Classic mode compiz expects the
>> traditional compiz window decorator to draw the panel shadow, but the
>> unity-window-decorator doesn't (??)
>>
>> ** Attachment added: "Screenshot.png"
>>   https://bugs.launchpad.net/ubuntu/+source/unity/+bug/731685/+attachment/2160213/+files/Screenshot.png
>>
>> --
>> You received this bug notification because you are a member of Unity
>> Bugs, which is subscribed to unity in Ubuntu.
>> https://bugs.launchpad.net/bugs/731685
>>
>> Title:
>>  Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
>>  Session
>>
>> Status in Compiz:
>>  New
>> Status in Unity:
>>  Confirmed
>> Status in “compiz” package in Ubuntu:
>>  New
>> Status in “unity” package in Ubuntu:
>>  Confirmed
>>
>> Bug description:
>>  When logging in with the session 'Ubuntu Classic Desktop' (with the
>>  traditional gnome environment) there seems to be a problem with the
>>  panel shadows drawn by Compiz. When moving a window close to one of
>>  the panels, the shadows seem to cancel one another out. I've attached
>>  a screenshot to show what I mean.
>>
>
>
>
> --
> Sam Spilsbury
>

--
Sam Spilsbury

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If it's unity-window-decorator that draws the normal window shadows, why shouldn't it also be made to draw the panel shadow in the same way? At most, unity-window-decorator would need a little bit of logic to match the Dock window type. Admittedly that might affect the Launcher too... But my limited understanding of the unity code is suggesting to me that there are two separate components which draw shadows, and really there should be only one.

I guess it falls into the bucket of re-unifying compiz-window-decorator and unity-window-decorator. I'm sure I saw a blueprint for that somewhere...

Please do correct me if this is just wild speculation :)

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

On Wed, Jun 8, 2011 at 3:16 PM, Daniel van Vugt <email address hidden> wrote:
> If it's unity-window-decorator that draws the normal window shadows, why
> shouldn't it also be made to draw the panel shadow in the same way? At
> most, unity-window-decorator would need a little bit of logic to match
> the Dock window type. Admittedly that might affect the Launcher too...
> But my limited understanding of the unity code is suggesting to me that
> there are two separate components which draw shadows, and really there
> should be only one.

In gnome-classic it draws the panel shadow, correct.

In unity, unity actually draws its own shadow on the panel. This is
because there's a giant hac^Winnovative solution (tm) that we use to
ensure that the panels get stacked correctly, yet we can blit them to
the screen with OpenGL. So what actually happens is that the input
windows for the panels are InputOutput and generally filled with
garbage, yet we don't actually draw them (see
unityshell.cpp:UnityScreen::getWindowPaintList). Instead, we draw all
the screen elements directly using OpenGL.

Because of this, the decor plugin is never able to "see" the panel
being drawn and thus it cant put the shadow that the decorator asked
to put on the panel on the panel.

This isn't really too important for the unity case though, since there
we're able to draw the panel shadow without painting the window twice
(expensive)

>
> I guess it falls into the bucket of re-unifying compiz-window-decorator
> and unity-window-decorator. I'm sure I saw a blueprint for that
> somewhere...
>
> Please do correct me if this is just wild speculation :)
>
> --
> You received this bug notification because you are a member of Unity
> Bugs, which is subscribed to unity in Ubuntu.
> https://bugs.launchpad.net/bugs/731685
>
> Title:
>  Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
>  Session
>
> Status in Compiz:
>  New
> Status in Unity:
>  Confirmed
> Status in “compiz” package in Ubuntu:
>  New
> Status in “unity” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  When logging in with the session 'Ubuntu Classic Desktop' (with the
>  traditional gnome environment) there seems to be a problem with the
>  panel shadows drawn by Compiz. When moving a window close to one of
>  the panels, the shadows seem to cancel one another out. I've attached
>  a screenshot to show what I mean.
>

--
Sam Spilsbury

Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Download full text (3.7 KiB)

In case you're wondering, the relevant code for the shadow clipping is here:

http://bazaar.launchpad.net/~smspillaz/compiz-core/trunk/view/head:/plugins/decor/src/decor.cpp#L77

What that does is for panels at least, recalculates every time a
window changes geometry, what should be "overlapping" the panel shadow
and then creates a region (eg nonrectangular space) of where the panel
shadow should be drawn so as /not/ to overlap those windows. Then on
::glDraw it clips the drawing of the panel shadow to that space.

However, this only takes into account the window position on the
assumption that *every window is exactly rectangular and not
transformed*. Which is obviously not the case considering that the
decorations have rounded corners.

Its probably possible to re-use some of the code from blur here:
http://bazaar.launchpad.net/~smspillaz/compiz-core/trunk/view/head:/plugins/blur/src/blur.cpp#L1215,
which is what blur uses to get the *exact nonrectangular clipping
area* for the blur underneath the window.

Unfortunately that code is largely undocumented and I haven't been
able to make it work for this case. Maybe a mathematical genius can
figure it out :)

On Wed, Jun 8, 2011 at 3:31 PM, Sam Spilsbury <email address hidden> wrote:
> On Wed, Jun 8, 2011 at 3:16 PM, Daniel van Vugt <email address hidden> wrote:
>> If it's unity-window-decorator that draws the normal window shadows, why
>> shouldn't it also be made to draw the panel shadow in the same way? At
>> most, unity-window-decorator would need a little bit of logic to match
>> the Dock window type. Admittedly that might affect the Launcher too...
>> But my limited understanding of the unity code is suggesting to me that
>> there are two separate components which draw shadows, and really there
>> should be only one.
>
> In gnome-classic it draws the panel shadow, correct.
>
> In unity, unity actually draws its own shadow on the panel. This is
> because there's a giant hac^Winnovative solution (tm) that we use to
> ensure that the panels get stacked correctly, yet we can blit them to
> the screen with OpenGL. So what actually happens is that the input
> windows for the panels are InputOutput and generally filled with
> garbage, yet we don't actually draw them (see
> unityshell.cpp:UnityScreen::getWindowPaintList). Instead, we draw all
> the screen elements directly using OpenGL.
>
> Because of this, the decor plugin is never able to "see" the panel
> being drawn and thus it cant put the shadow that the decorator asked
> to put on the panel on the panel.
>
> This isn't really too important for the unity case though, since there
> we're able to draw the panel shadow without painting the window twice
> (expensive)
>
>>
>> I guess it falls into the bucket of re-unifying compiz-window-decorator
>> and unity-window-decorator. I'm sure I saw a blueprint for that
>> somewhere...
>>
>> Please do correct me if this is just wild speculation :)
>>
>> --
>> You received this bug notification because you are a member of Unity
>> Bugs, which is subscribed to unity in Ubuntu.
>> https://bugs.launchpad.net/bugs/731685
>>
>> Title:
>>  Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
>>  Se...

Read more...

Changed in compiz:
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Changed in compiz (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually, the above bug 900 was already fixed as launchpad bug 91786. That fix was present up to maverick but go dropped in natty because an alternate fix was applied upstream to compiz 0.9.4, and so was in natty. It is that alternate fix in compiz 0.9.4 which is flawed and the cause of this bug.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

On Tue, Aug 9, 2011 at 5:20 PM, Daniel van Vugt <email address hidden> wrote:
> Actually, the above bug 900 was already fixed as launchpad bug 91786.
> That fix was present up to maverick but go dropped in natty because an
> alternate fix was applied upstream to compiz 0.9.4, and so was in natty.
> It is that alternate fix in compiz 0.9.4 which is flawed and the cause
> of this bug.

The fix that was in maverick was essentially a hack. We can't have it
upstream because it paints windows twice.

There is a smarter way to do the shadow clipping the way I have it
upstream, namely, you need to project the transformed window geometry
of windows below the shadow and set that to be the clip region of the
panel shadow. I know that the blur plugin does this (see
blur.cpp:projectRegion and blur.cpp:projectVertices)

>
> --
> You received this bug notification because you are a member of Unity
> Bugs, which is subscribed to unity in Ubuntu.
> https://bugs.launchpad.net/bugs/731685
>
> Title:
>  Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
>  Session
>
> Status in Compiz:
>  In Progress
> Status in Unity:
>  Confirmed
> Status in “compiz” package in Ubuntu:
>  In Progress
> Status in “unity” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  When logging in with the session 'Ubuntu Classic Desktop' (with the
>  traditional gnome environment) there seems to be a problem with the
>  panel shadows drawn by Compiz. When moving a window close to one of
>  the panels, the shadows seem to cancel one another out. I've attached
>  a screenshot to show what I mean.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/compiz/+bug/731685/+subscriptions
>

--
Sam Spilsbury

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Aesthetically I think what I have proposed is nicer than any of the previous fixes. Nicer especially because it is simple, elegant and avoids stencilling or complex geometry calculations.

Changed in unity:
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A fix for this bug is available for testing in ppa:vanvugt/compiz
https://launchpad.net/~vanvugt/+archive/compiz

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix has been committed to lp:compiz-core at rev 2805. So it's going upstream...

Changed in compiz-core:
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in compiz:
status: In Progress → Fix Committed
Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

I've just applied that patch to the version of Compiz in Natty, build locally tested it, and the bug seems fixed. I've pushed my source package to a PPA as well:

https://launchpad.net/~pmjdebruijn/+archive/compiz-release

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Oh right, you did a PPA with a newer version of Compiz as well, completely missed that.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.5.94+bzr20110919-0ubuntu1

---------------
compiz (1:0.9.5.94+bzr20110919-0ubuntu1) oneiric; urgency=low

  * New upstream snapshot:
    - "maximized windows fail to update their input extents when undecorated"
      (LP: #853734)
    - Panel shadow conflicts with Window shadow in Ubuntu Classic Desktop
      Session (LP: #731685)
    - "unity-window-decorator: When switching between windows, Orca does not
      speak the title of the focused window (LP: #724093)
    - Dash and launcher appear underneath windows (LP: #805087)
    - A minimized window 'remains' behind on the desktop if
      /apps/<…>/show_minimized_windows is set to true (LP: #847967)
    - compiz and X can disagree on stacking order (LP: #845765)
    - Should keep a list last sent and last recv from server (LP: #841727)
    - Minimize animation flickr when for maximized apps (LP: #737125)
    - Dash and launcher appear underneath windows (LP: #805087)
    - Stacking problem when switching between apps with multiple windows
      (LP: #802527)
 -- Didier Roche <email address hidden> Thu, 22 Sep 2011 14:49:10 +0200

Changed in compiz (Ubuntu):
status: In Progress → Fix Released
Changed in compiz:
status: Fix Committed → Fix Released
Changed in compiz-core:
status: Fix Committed → Fix Released
no longer affects: unity (Ubuntu)
affects: unity → unity (Ubuntu)
no longer affects: unity (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.