KWin effects in Windows Vista

There has been a Feature Request to port KWin to the Microsoft Windows platform (see Bug 182700) and we have started secretly to port KWin to Microsoft Windows Vista. And today we are proud to announce that there will be a first release for the Microsoft Windows platform with KDE 4.3.

Of course porting an application that is tied so much to the X11 platform is not a simple task. That’s why we won’t provide the window manager functionalities in the first version. There will only be the compositing effects. Microsoft allows to access Vista’s Aero features so we just had to implement a new Direct3D backend. KWin’s compositing support is very modular and there are already two backends OpenGL and XRender, so adding support for Direct3D is not that difficult. So we added a new scene_direct3d.cpp file which handles the compositing the same way as the existing scene_opengl.cpp.

A more complicated task were the EffectWindows which represent a window in the effect. In the current implementation it is tied to X Clients: managed, unmanaged and deleted clients. These types have the parent class TopLevel. So what we needed was a new Client implementation called WindowsWindow. We are not able to manage those windows as porting the window management functions is – as said – too difficult. So for the effects everything is transparent, nothing changed. When accessing an EffectWindow in X11 it will be a managed or unmanaged client, in Microsoft Windows it’s an WindowsWindow.

Of course our Effect API allows to access all the window management functionalities. It would be kind of a joke if you have the cube but cannot change the desktop. As the Microsoft Windows plattform does not know the concept of virtual desktops we can of course not provide these API calls. So we had to implement a WindowsEffectsHandler Implementation which provides access to all the functions for API compatability and just returning dummy values. effects->numberOfDesktops() will always return 1. That is effects relying on effects->numberOfDesktops() > 1 will not work. So no cube effect 🙁

We have now reached a point in the porting effort that we are confident to have all the important effects ported till hard freeze. CoverSwitch and FlipSwitch are already working, also small effects like MagicLamp and MinimizeAnimation are nearly done (we still have some problems with retrieving the icon position).

I think you want to see a screenshot of current state. As FlipSwitch was the first effect to use 3D in KWin I finished this port first and here it is:
KWin FlipSwitch in Windows Vista

Unfortunately nobody from KWin team registered for a Windows 7 beta licence. So we are currently unable to test with the upcomming release. We hope that Microsoft will see the chances a good and working Compositing implementation will provide for their platform and that they will provide us all needed help including licences for the new version.

10 Replies to “KWin effects in Windows Vista”

  1. On the other hand, there are programs like “Switcher” that use the Aero engine realize an Expose like effect. So in the end, the whole idea is not THAT much of a joke. Yet I guess the code base would need some heavy lifting to make it cross-platform 😉

  2. That joke could have been done better. For example, Vista is the fist Windows release that ships with accelerated OpenGL out of the box. So that Direct 3D porting crap could have been cut and instead the GL support could’ve been cited as a reason why it’s Vista only.

  3. @Markus: AFAIK the Aero Part is written in Direct3D and provides only a Direct3D interface. At least I remember that MS wanted to disable OpenGL completely when Aero is enabled.

    The reason why I said that it requires Windows Vista is that Vista is the first Windows release with Compositing support (called Aero).

  4. I think the people who did fell for the joke are now all in silence… :-p

    (I at least did believe it for a moment… hehe, good joke!!)

Comments are closed.