BeShadowed

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

10
7 .7
Description:

*** THIS IS COMPLETELY OUTDATED ***

Current versions of KWin have a dfferent shadow system since 4.7
This is only kept for legacy reasons.

DO NOT USE IT ON THOSE.


Since the Oxygen decoration paints it's own shadows, the shadow plugin got pretty stepchilded.

a) it's horribly imperformant (if I play a video it's causing ~2/3 of the kwin cpu load...)
b) it's broken with XRender & translucency
c) it could use some more options ;-)
d) The heavy exponential shadow is maybe nice, but neither realistic (real shdows cast rather sharp borders), nor effective (most of the HUGE shadow is so much translucent that you can hardly see anything of it...)

So I started to work on it.
Not much of a help for oxygen, but most other decorations (QtCurve has deco shadows as well), consistent and (hopefully) less artefact prone ;-P

Ultimately this should go back upstream but testing outside the release cycle won't hurt - i assume :)

Version 0.1 performance is up to decoration shadows for one window (heavy repaints in a video) but doesn't scale as good, there also might be artefacts left (didn't see any though) but good enough for a first version, i hopefully can speed up things even more
Last changelog:

9 years ago

0.8a
----
- git master GL support, nothing else (notice that kwin 4.7 will have a revamped shadow system anyway)

0.8
----
- fix popup clipping when no desktop window is in use (corner case)
- fix XRender shadows for tiny windows

0.7
---
- add property support to force shadows
- add launcher script to run chromium with this property
- add flag for translucent decorations (aurorae, oxygen) to fix "corner" artefact (will be autodetected with 4.5, but not "implemented" yet)

0.6
---
- fix skip conditions (override property, undecorated ARBG windows)

0.5
---
- fix remaining artefact (with fading windows that exceed the screenarea)
- avoid some useless shadow paints with translucent windows (though quite a corner case)
- add new shot to show off tronhalo mode ;-)

0.4
---
- fix tiny window shadows better ;-)
- fix property system*
- optionally skip maximized windows (on by default, makes sense depending on your desktop setup)
- skip fullscreen windows (e.g. when not redirecting)

* the shadows are supposed to support a _KDE_SHADOW_OVERRIDE property - but they didn't ;-P
set with e.g.:
xprop -f _KDE_SHADOW_OVERRIDE 32a -set _KDE_SHADOW_OVERRIDE 1
unset with:
xprop -f _KDE_SHADOW_OVERRIDE 32a -remove _KDE_SHADOW_OVERRIDE

0.3
----
- even more performance ;-)
- Halo mode
- "fixed" shadow painting for tiny windows and large fuzzyness

0.2
----
++performance;
--artefacts;
* custom colors for active windows (but using plain QPalette::Shadow as default for both and the moment - we'll have to use sth. like additive painting for _real_ halos -> 0.3 ;-)

takanowaka

10 years ago

i'm pretty sure i've restarted even X ;)

Report

takanowaka

10 years ago

draw behind windows was checked.. hmm.. i understand your point but still it's mysterious to me that sometimes it works ok and sometimes not..

and i got my answer before i even asked - about ARGB support ;)

yea that might be the solution.. but i'm not really sure if someone except of me would find it useful ;)

Report

ElTimo

10 years ago

When using the default Oxygen theme, the shadows leave a gap around the rounded corners. Would there be any easy way to fix this? It looks really dumb.

Of course, I could always enable "Draw behind windows", but that isn't quite as fast as the normal method.

Report

C

thomas12777

10 years ago

humm?
the shadows are not applied to normal windows if you use the oxygen decoration.

do you mean on popups?
(can you make a screenshot?)

Report

ElTimo

10 years ago

Ah I did mean popups. It's not really a big deal I suppose, since most users will use this with Bespin or QTCurve.

Report

C

thomas12777

10 years ago

actually the feature to not "draw behind windows" makes most sense regarding decorations painting their own shadows (like oxygen) as the decoration (at least atm) cannot do that by design.

i however wonder what you experience, the only case i could think of would be that the oxygen widget style meanwhile paints argb popups + shadows (not tried the trunk version for some time) in which case there should no be any external shadows either.

as this will need some more precise checking of the popup shadowing condition, i'd really appreciate to see a screenshot for fast inspection ;-)

Report

AlejandroNova

10 years ago

http://yfrog.com/1ncornerdp

BTW, look carefully into it. I think this is more of an Oxygen bug than a BeShadowed bug, because I've also seen weird behaviour with rounded corners and without Composite.

Maybe you can untap a bug. Or I may be wrong and the bug is with your app ;). Cheers and keep going!

Report

C

thomas12777

10 years ago

it's because of the ARBG part (the popup is unmasked and rectnagular, just a small portion is entirely translucent)
this is related to the Arorae thread below and needs a general "solution" (although in this case this really should be worked-around by enabling shadows behind windows.)

Report

admoore

10 years ago

i just compiled this and installed it on my system. It does not seem to work with Aurorae window decorations. With other window decorators it works fine (crystal, keramic, etc), but not aurorae.


Report

C

thomas12777

10 years ago

nope - aurorae, oxygen, i think chromi (and qtcurve optionally) paint their own shadows.

thus they're ignored to avoid conflicts (there's a flag on the decoration)

Report

squall38

10 years ago

This is awesome, it pretty much *fixed* compositing performance on my Geforce6. Thanks a ton!

I noticed however that many Plasma-related popup windows (like kmenu) show an additional shadow the first time I open them (afterwards they look fine).

Report

C

thomas12777

10 years ago

yupp - apparently the _KDE_SHADOW_OVERRIDE property type was actually supposed (what makes it hard to set via xprop)

i'll add support for both property types ;-)

Report

koral

10 years ago

In my crazy shadow configuration (v-offset:2, fuzziness:32, active-size:30) when the shadow is drawn over a very small element (like the application startup notification or other 16x16 smallwindows) there is some problem in the update area.

It's only a matter of enlarging the
exposed area I hope.

Report

C

thomas12777

10 years ago

good news: i fixed the painting
bad news: with your setup, tiny windows won't cast a "visible" shadow at all (due to the high fuzzy degree, as only the other area is painted)

we'll have to see how to deal with this (e.g. either adjust size or opacity to the window size...)

Report

koral

10 years ago

Wow, tested and works great!
no more problems, oh wait, I got a glitch in creator... let me test it:
done, it works :D
I'd say, replace the KDE shadow plugin with yours, much better performance, much better results!

Report

9

TheRob

10 years ago

+1

Report

C

thomas12777

10 years ago

not crazy, nicely lifted ;-)

i can confirm the issue, but no: it's unfortunately not that trivial :-(

with the current painting the shadow size of the entire window needs to be twice as big as the fuzzyness, or you get shaped borders - this is neither what the code thinks when it transforms the damage region, nor what you configured.

i'll try to fix the painting, so that you can have heavily fuzzy shadows on tiny windows w/o freaking around with the shadow size :)

Report

mpeti

10 years ago

It fails compiling on my system, debian testing with kde 4.3.4 and Qt 4.5.3

details:
http://pastebin.com/Va8u8saJ

Report

C

thomas12777

10 years ago

the code derives from the 4.4 plugin, 4.3 support is not guaranteed

i could workaround this particular issue by either feature restriction or performance cost, but that does not guarantee it works with 4.3 then :-(

(i recommand to update KDE, but given the quality of the original plugin, tell me if you really, really, really need 4.3 support :)

Report

mpeti

10 years ago

Ops, my fault. I didn't checked the version numbers, I wait for kde 4.4 in testing.

Report

koral

10 years ago

Google image search for "philips aurea".

This will be really CPU intensive (or GPU shader offloaded ;-) but the concept is to cast colors from the edges of a window instead of a shadow. Colors should be casted if the "value" is high.

If this can be done, it could produce really cool graphics effects, maybe too much :D

Report

C

thomas12777

10 years ago

"ambilight (tm)" should not be _that_ expensive at all (perfect parallel O(n) for a "minor" outer region, like 2*w*h*16, to scan average colors in arbitrary blocksizes and then paint blending vertices), but:

this is designed for the pretty specific "bright content in dark surrounding" case, i.e. you need:
a) a dark wallpaper
b) a dark window frame
c) bright content for active windows
d) dimming for inactive windows

-> it's more topic for a specific "show-off" effect (as the majority of users would never use such setup, no matter what cool it looks like ;-)

Report

koral

10 years ago

I've tried BeShadow and I'm really really really happy about the result. Finally shadows are *faster*!

This plugin looks *lots* better than Oxygen's shadows, since any windowed element (popups, launch notifications & co) cast shadows.

I hope this will replace the old shadow code, and if performance (already good) is improved, even better!

Report

CraigD

10 years ago

The shadow code in QtCurve is a direct copy from the Oxygen decoration - with a few tweeks on the colour settings.

The only reason for the QtCurve shadow code (which is turned off by default), is so that the active window can have a different coloured shadow to inactive ones.

Could this plugin not also have this option? Must admit that it would make more sense in a generic (and not decoration specific) plugin.

If you do, then - as per QtCurve - I think it should use the predefined colour settings. e.g. focus colour, active window titlebar colour, etc - and not a specific colour value. So that the shadow colour follows the user's colour scheme.

Report

C

thomas12777

10 years ago

yes, makes sense for esp. dark setups where the "shadow" is more kind of a "halo" ;-)

Report

9 years ago

0.8a
----
- git master GL support, nothing else (notice that kwin 4.7 will have a revamped shadow system anyway)

0.8
----
- fix popup clipping when no desktop window is in use (corner case)
- fix XRender shadows for tiny windows

0.7
---
- add property support to force shadows
- add launcher script to run chromium with this property
- add flag for translucent decorations (aurorae, oxygen) to fix "corner" artefact (will be autodetected with 4.5, but not "implemented" yet)

0.6
---
- fix skip conditions (override property, undecorated ARBG windows)

0.5
---
- fix remaining artefact (with fading windows that exceed the screenarea)
- avoid some useless shadow paints with translucent windows (though quite a corner case)
- add new shot to show off tronhalo mode ;-)

0.4
---
- fix tiny window shadows better ;-)
- fix property system*
- optionally skip maximized windows (on by default, makes sense depending on your desktop setup)
- skip fullscreen windows (e.g. when not redirecting)

* the shadows are supposed to support a _KDE_SHADOW_OVERRIDE property - but they didn't ;-P
set with e.g.:
xprop -f _KDE_SHADOW_OVERRIDE 32a -set _KDE_SHADOW_OVERRIDE 1
unset with:
xprop -f _KDE_SHADOW_OVERRIDE 32a -remove _KDE_SHADOW_OVERRIDE

0.3
----
- even more performance ;-)
- Halo mode
- "fixed" shadow painting for tiny windows and large fuzzyness

0.2
----
++performance;
--artefacts;
* custom colors for active windows (but using plain QPalette::Shadow as default for both and the moment - we'll have to use sth. like additive painting for _real_ halos -> 0.3 ;-)

12345678910
8
product-maker deabru Jul 04 2011 9 excellent
product-maker axed May 16 2011 9 excellent
product-maker srog Feb 15 2011 9 excellent
product-maker juank202 Jan 31 2011 9 excellent
product-maker sxe Jan 30 2011 9 excellent
product-maker FSchulz Jan 28 2011 9 excellent
product-maker TommyCZ Jan 08 2011 9 excellent
product-maker TheRob Oct 17 2010 9 excellent
Be the first to comment
olegue
Sep 09 2011
axed
May 16 2011
marcotangaro
Jan 30 2011
AlejandroNova
Jun 07 2010
mbluethgen
May 04 2010
MoonBlossom
Apr 11 2010
squall38
Mar 25 2010
TheRob
Mar 16 2010
deabru
Mar 15 2010
lordlukas
Mar 15 2010
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.8a
updated Feb 14 2011
added Mar 14 2010
downloads 24h
0
mediaviews 24h 0
pageviews 24h 1