One of the features which got killed in the process of porting KWin’s Compositor to OpenGL ES was the Shadow effect. For some time already the Shadow effect was not on the level we expect from our components. The code had become too complex to maintain and the port to OpenGL ES would not have been trivial. So the port was a good point to step back and think about what we actually need in the Shadow effect.
For quite some time we have an improved shadow system which allows the window decoration to provide the Shadow for decorated windows. This is used by e.g. Oxygen, QtCurve and Aurorae. So most windows already have a very advanced and good looking shadow. The Shadow effect itself is only used for so-called unmanaged windows such as menus or drop-down lists and for “legacy” window decorations such as Plastik.
The obvious disadvantage is that menus have a different shadow than all other windows. This means the designers do not have control over the shadows. But shadows are an important part of the design. A shadow should follow the widget style’s light model and by that one shadow to rule them all is just not possible.
Since I started to consider dropping the Shadow effect I have been in contact with mostly Hugo from Oxygen fame to gather the requirements for a new Shadow system. After long and fruitful discussions also including members from other Widget Styles and Compiz we designed a new system
. Hugo recently implemented the Oxygen part and this weekend I implemented the first OpenGL version of the new system:
The main difference to the old system is that the Shadow is no longer an effect but moved directly into the Compositor. This follows the approach of the Decoration Shadows which are also directly in the Compositor. By moving the Shadow into the Compositor we can better control and optimize the rendering process. The compositor itself knows about the existence of the Shadow and can update the correct screen areas. As the shadow is rendered together with window it follows automatically opacity or transformations like wobbling.
A nice addition of the new Shadow system is that it is completely controlled by the to be rendered window which allows to use it also for Plasma elements such as the Panel shadow or in KRunner (yeah no more clickable Shadow). What could also be very nice is to use it for shaped windows. Up to now windows with custom shape could not get a Shadow as our effect just could not know if it looks good in the end. The window itself knows its shape and can provide a shadow adjusted for the window. So maybe Yakuake will soon have a Shadow 🙂
If someone wants to test it, you can build the kwin/oxygen-shadows branches in kdelibs and kde-workspace. There is still some work to be done like the XRender implementation, some optimizations and currently “normal” windows are not yet supported. Also we would like to have some fallback for windows not useing either Oxygen decoration or widget style.
I hope that we can bring our system as an addition to the EWMH specification. The system has been designed to not be KWin or KDE specific and it’s a usecase actually required in all Desktop Shells.
Powered by Blogilo
22 Replies to “New KWin Shadows”
Awesome work! I hope this will become part of the specification.
That particular shadow looks a bit cartoonish (in a good way, I like it). 🙂
I agree, it looks really beautiful.
Great! Hopefully this will fix the issues with shadow compatibility. Out of curiosity, does the new shadow system take into account the z-order of windows?
No, the primary use case for the new shadow system are unmanaged windows which are always topmost in the stacking order.
Thank you for this great work!!! I also like the shadow in the screenshot.
Okay. Shadows. Instead of fixing the errors and lags and KDE you adds new shadow system. WOOHOO. Bravo.
No, seriously, I’m outta here.
Any idea how many bugs and performance lags the new shadow system solves? Any idea why I spent time on implementing it?
Meh… Haters gonna hate.
Given your demonstration of sheer ignorance, it’s any wonder you were here at all. Don’t worry: you won’t be missed.
Bye. Nobody’s gonna miss you.
I don’t understand something, when will this new shadow system be used, and when will widget draw their own shadows?
With this new system, will oxygen for example draw shadows of the menus and “unmanaged windows”?, if not what does this new system fix?
The new system gives control to the widget style (in most cases Oxygen) to define the shadow instead using a generic one. Hope this answers the question
I still don’t understand something, in this new system which shadow is used for menues and unmanaged windows? generic or widget style?
Under the new shadow system, there is no, “generic” shadow. If the application doesn’t define shadows, it doesn’t draw them.
Just wondering: does this leave open the possibility of translucent shadows? That’s been my biggest gripe of oxygen-shadows so far.
What is a “translucent” shadow?
Semi-transparent – “see through”. Right now, they’re big black blocks, which you can see by increasing their size.
yes the shadow has an alpha channel, so it depends completely on Oxygen and the shadows they pass to KWin.
Also, these “menu buttons” should be standard in every app, and put into the list of possible buttons when customizing the toolbar (no talking about defaults)
Sorry but I meant the comment I’m replying to
The shadow in the screenshot is much too intense. Will it be possible to reduce it’s opacity?
Comments are closed.