Translucency / Shadows

With 6.8 Keith Packard's damage/composite extensions became part of the official release tree (though not activated by default)
Though far away from being perfect, this allows e.g. the use of the alpha channel, i.e. translucency and therefore shadows.
Before getting too technical, discussing about the advances and disadvances of this way to get eye candy, i'll better show a screenshot:

A sample Desktop Screenshot

Now, after showing the possible i'll give you a little advice to bring this to your screen.

Download links


If your Xorg is properly configured to run translucency, xcompmgr can be installed by common "./configure; make; make install"
To apply the kwin patches, get a clean copy of kwin, decompresss kwinxcompmgr.diff.bz2 into the kwin folder
bunzip2 kwinxcompmgr.diff.bz2
and apply the patch.
patch -p1 < kwinxcompmgr.diff

You may want to first try if the patch applies correctly, try
patch --dry-run -p1 < kwinxcompmgr.diff
Also you should create backup files, if you really want to get rid of the patch
patch -b -p1 < kwinxcompmgr.diff

The Substructure

First of all, you need a copy of ≥ 6.8.
    There are three ways to get it
  1. Your distribution luckily provides a binary package:
    Download and install it - your done.
  2. Your distribution does not provide them yet:
    X is quite strictly organized. It usually places everything into /usr/X11R6/.
    If you don't have a very querky distribution and match all the prerequirements, you can perhaps use a foreign package
  3. You cannot or do not want to use any binary package:
    You still can download the sources, read the INSTALL file and compile yourself.
    It may take some time, but don't worry - most of the time your system is just waiting for its slowest component - you ;)


Composite is disabled by default (be aware, some things might not work after enabling the composite extension - to me kuickshow started to display black screens and xmms bugged me about gdk mismatches...), so you need to activate it.

Open your X config file (e.g. /etc/X11/XF86Config or /etc/X11/XorgConfig) with the appropriate rights (i.e.: be root) and enter the following section:

    Section "Extensions"
	Option "Composite" "Enable"
e.g. among the SeverFlags Section.

If you have any kind of Hardware Acceleration, you should try to use it.
Add this line to "Section "Device""

        Option     "RenderAccel" "true"
At least on nVidia Systems, this will help alot.

I Want Candy

Ok, you made it up to this stage? You're allmost done.
What you need now is something to render you a nice Desktop.
The composing manager is xcompmgr.
You can either grab it out if freedesktops cvs tree, or download a patched version from here.
The local version contains several patches written by myself and Heiko Przybyl.
Besides config file support, they provide some advances for the use in combination with the patches to kwin
In particular, the combination of these patches allow you to have translucency and shadowsizes to be automatically set.


Q: X crashes when starting xcompmgr
A: I don't know, why this occurs, but Good God, do not start xcompmgr while any slider is moving (e.g. in kscd, kaffeine, juk, amaroK,...).
Everything works fine while xcompmgr is running - but not on startup
Q: I use the nVidia binary only XSever, Version 6629.
After Activating the composite extension, i can't run any GLX applications such as glxgears anymore!
A: Add this line to "Section "Device"" and restart X.
        Option  "AllowGLXWithComposite" "true"

Q: I try to watch a video, but only see artefacts in the Video Window.
A: You're using "xv" as video backend. This is the overlay mode, where the video content is written directly into the GRAM - bypassing X. Therefore the window seems to be static (colored background) and is not updated by the damage extension.
There will hopefully be a fix for this in the future. Currently i had best results using Xine - but displaying translucent videos isn't fast anyway :(
Q: After enabling the Composite extension, Kuickshow displays only a black square instead of showing a window.
A: The Composite extension seems to mess up Kuickshows assumptions about the ARGB settings, hää??
Solution: Open the Konqueror configuration Dialog, go to the file association section, type e.g. jpeg and edit the Kuickshow settings
Replace the execution command
kuickshow %i %m -caption "%c" "%U"
/bin/sh -c "export XLIB_SKIP_ARGB_VISUALS=1; kuickshow %i %m -caption %c %U"
You may also want to apply those change to the Kuickshow entry in KMenu.
Q: After enabling the Composite extension, XMMS refuses to start!
A: True, the gtk 1.x gdk part does not work too good with the Composite extension and i do not know a patch to correct that.
Furthermore - any gtk 1.x application won't work too good with the xcompmgr, because it will allways appear additive composed (if you place the gtk 1.x window over a white background, you won't see anything
At least for XMMS, the Beep Media Player (xmms gtk 2.x port) is a good solution. It does a very good job and gtk 2.x looks much better anyway =)
Q: I have activated the "RenderAccel" option, but the windows still move somehow sticky slow.
A: XComposite redirects the window contents through the CPU. Therefore as soon as the cache is exceeded, speed will break away dramatically.
So basically there are (currently) three ways to get more speed:
1: Rise cache amount (i.e. buy a new CPU :(
Disadvance: costs money...
2: Lower screen resolution (e.g. 1024x768, you can simply type xrandr -s WIDTHxHEIGHT to test resolutions)
Disadvance: Less space, bad for coders, artists, allmost anyone...
3: Lower screen depth (e.g. use 16bbp instead of 24)
Disadvance: Less smooth display, very bad for artists, as they'd need true color