Bug 157353 - Support shadows for non-rectangular windows
Summary: Support shadows for non-rectangular windows
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 143309 183872 219228 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-07 18:56 UTC by Ivan Čukić
Modified: 2011-07-31 17:45 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Attachments
Examples of shadow (178.53 KB, image/png)
2009-02-24 17:23 UTC, Yann Droneaud
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Čukić 2008-02-07 18:56:57 UTC
Version:            (using Devel)
Installed from:    Compiled sources

Non-rectangular windows (the windows using compositing to achieve non-rectangular appearance) such as Plasma's dialogs (calendar you get when you click the clock, recently plugged devices pop-up), KRunner, Raptor, Lancelot... shouldn't have a rectangular shadow added by kwin.

There is no need for kwin to apply shadows for such windows at all because the shadow is built into the theme.
Comment 1 Eike Hein 2008-02-07 19:09:36 UTC
Rendering shadows for shaped windows was actually disabled leading up to the KDE 4.0 release. Either they've been re-enabled recently, or you're testing with a pretty old build.

I'm pretty unhappy about losing shadows for shaped windows, though. Doing them right is hard and performance-intensive, unfortunately.
Comment 2 Ivan Čukić 2008-02-07 20:32:05 UTC
It's today's build.

I remember that it was fixed (it was mentioned on panel-devel).
Comment 3 Lubos Lunak 2008-02-07 20:57:09 UTC
The point is that those windows are not actually shaped, just because they appear to be shaped, just like not everything painted in steel gray is steel. And, as far as KWin's shadow goes, it is planned that in 4.1 it will have a shadow implementation that will be able to properly add shadow even to shaped windows.
Comment 4 Ivan Čukić 2008-02-07 21:12:45 UTC
Yes, I'm aware of that. (as I said "to achieve non-rectangular *appearance*")

You mentioned on the list[1] that it'll be added to 4.0-TODO, so I was just wondering what was happening with this.

[1] Re: [Panel-devel] Plasma and the window manager (Re: KDE/kdebase/workspace/plasma/plasma)
From: Lubos Lunak <l.lunak@suse.cz>
Date: 2007-11-20 15:07
Comment 5 Aaron J. Seigo 2008-02-11 02:12:00 UTC
i'd almost consider this a wishlist item, personally.

anyways, once kwin supports drop shadows on shaped windows, then you can either close this outright or re-assign it back to plasma so we can check to make sure all our windows are properly shaped.

as for the theme containing the shadow: that's simply because the default theme is actually not complete. the plasma dialog svg should actually *not* have its own drop shadow.
Comment 6 Marco Martin 2008-02-11 12:32:22 UTC
so kwin will be able to manage also very fancy things like the standard background that has a shadow under the outer border and another one under the inner black center underlying the semitransparent border?
imho it looks very cool and it would be a pity to lose the possibility to do such effects
Comment 7 Lubos Lunak 2008-04-08 17:53:38 UTC
*** Bug 143309 has been marked as a duplicate of this bug. ***
Comment 8 adibudeen 2009-01-07 18:58:16 UTC
I have KDE 4.2 Beta 2 installed on Kubuntu 8.10, and this problem or a very similar one exists with Adobe Air applications.  Most of them have a huge rectangular shadow (much larger than the window).

None of the shadow settings (short of disabling desktop effects completely) frees them from their ugliness.
Comment 9 lucas 2009-02-10 06:21:35 UTC
*** Bug 183872 has been marked as a duplicate of this bug. ***
Comment 10 Yann Droneaud 2009-02-24 17:23:40 UTC
Created attachment 31611 [details]
Examples of shadow

In the picture attached, 
one can see the old xeyes program using XShape. 
Below, one Google Gadget with a square shadow, then my test program showing a Composite window (with shadow) and a XShape window (without shadow). 
As you can see, it's quite ugly.

It could be possible to create a non rectangular shadow for XShape window, using XShapeGetRectangles() to retrieve the shape of the window, watching ShapeNotify event for update.

But for translucent window using ARGB content, it's not so easy, in fact it is quite difficult: detecting content borders (edge) and watching for content update, I don't know how to do it easily.
Comment 11 Martin Flöser 2009-12-18 20:04:01 UTC
*** Bug 219228 has been marked as a duplicate of this bug. ***
Comment 12 Martin Flöser 2011-03-09 20:35:04 UTC
no shadow in master any more, new implementation will require the window to request the shadow/provide the shadow itself. Soon to be implemented :-)
Comment 13 Martin Flöser 2011-07-31 17:45:03 UTC
new shadow system added with 4.7 allows ARGB windows to set own shadows as e.g. done by Plasma -> FIXED