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.

New KWin effect: Sheet

I implemented a new KWin effect called “Sheet”. It animates modal dialogs. The dialog is rolled up and flys in from the parent window. Well difficult to describe it with words. So here’s a video (of course speed is set to very slow):

Link for Planet or RSS readers

Currently you don’t want to use the effect if fade effect is enabled as well. The two effects have different durations, so the dialog is completly faded while still being rolled up.

Work on cube is still going on and new features are added. Yesterday for example I surrendered and implemented the 3D Windows feature due to many requests. So windows can hover above the cube. It’s actually one of those features I don’t like myself but Compiz has it, so it had to be implemented πŸ˜‰

Once again an image says more than thousand words:
cube-3d-windows

There are still small glitches caused by the painting sequence, but nothing that couldn’t be solved.

Cube and pager

As it is quite obvious the cube effect cannot use the desktop layout defined by the pager. For cube the layout has to be

+--+--+--+--+
| 1 | 2 | 3 | 4 |
+--+--+--+--+

That’s basically how the user would expect the cube to work. All virtual desktops are mapped to the faces of a geometric object. That’s how we know it from Compiz. But this layout used by cube does not represent the actual layout which is in case of 4 desktops like that

+--+--+
| 1 | 2 |
+--+--+
| 3 | 4 |
+--+--+

In my opinion it is impossible to use this layout for cube. Of course you could do something like having just two faces and scaling the desktops so that (1,3) is on one face and (2,4) is on the other face. But that makes the cube effect kind of useless. It would require to have at least eight desktops in a 2×4 layout. But I don’t expect that someone using 8 desktops will ever use cube. I personally think cube effect is more for the normal user, but not for the power user. And I’d say having 8 desktops is kind of power using πŸ˜‰

So cube effect has to ignore the desktop layout which is OK and even allowed by EWMH.

But when using cube to animate change of desktop via pager, via ctrl+f1-4 or via active desktop borders it should use the desktop layout. E.g. when you use the pager to switch from desktop 1 to 3 in the above shown layout you’d expect the animation to go down and not twice to the right. You’d expect the same behaviour as in slide animation.

For using pager and ctrl+f1-4 it’s still usable as it’s, but when you use active desktop borders and drag a window to another desktop it becomes painful. E.g. you drag a window from desktop 1 to the left. Thinking of the cube you will end up in desktop 4, but in fact you end in desktop 2. You move your window to the left, but receive an animation to the right. Even worse when you move a window to the top or down. Instead of having an animation going downwards or upwards you animate twice to the left or right. The animation does not reflect at all what triggered the animation. That’s probably one of the reasons why I myself do not use cube effect to animate the desktop change πŸ˜‰

So you might have guessed it: I worked on improving this situation and there is a new solution to the problem available in my git branch. It will need some more work before it can be merged to trunk (there are more improvements than this one). While animating the desktop change cube follows the pager layout. That is changing from desktop 1 to 3 will result in an animation downwards, changing from 1 to 4 will result in an animation to the right and one downwards. Here’s a screenshot of what it looks like:
cube-vertical

The screenshot illustrates another new requested feature: you can keep the panels in place while the cube rotates. I like it very much and I think it will change from currently opt-in to an opt-out πŸ˜‰ Of course this feature is not available in ctrl+f11 mode.

Btw currently it is the best time to request features for cube. At the moment I have no lectures and no upcoming exams. So I have lots of time and I am working on cube. So I’m waiting for your feature requests at bugs.kde.org πŸ˜‰

No more video garbage

Good news to all Kubuntu and Fedora users. The cause for the video garbage appearing whenever a new window is opened has been discovered. A custom patch to xorg is causing the trouble. Now we can only hope that the distributions will provide updates for xorg without this patch. If you don’t want to wait that long and you are a Kubuntu user just add the following ppa to your sources.list and upgrade your system:

deb http://ppa.launchpad.net/adamspain/ubuntu intrepid main

The interesting thing is that NVIDIA knew about this patch for at least one month and started to work around it in their drivers. That’s great as it shows that they care about KDE and want to improve the KDE experience. The bad is that they did not communicate that a custom patch to xorg is responsible for the problem. Neither in KDE’s nor in Ubuntu’s bug report there is a comment from NVIDIA. And that’s sad. With a little bit more communication the problem would have been solved much earlier.

What’s going on with CoverSwitch?

Thanks to a cold and the decision not to attend classes today I found some time to work on CoverSwitch again and to blog about the new features I’m working on.

Some time ago I started to port CoverSwitch to new possibilities introduced by Cube. So we do not have to define an own perspective projection as KWin is already using a perspective projection. For those who are intersted: it is exactly the same projection matrix as used by Compiz. And I must say that CoverSwitch looks better now. The porting is not yet finished as there is a regression with multi screen setups. That’s the reason why it has not yet hit trunk.

Today I introduced a new feature I once saw at kde-look. Btw. kde-look is not the best place to inform developers about feature request. If I hadn’t visited kde-look on that day there would not be this new feature πŸ˜‰ A thumbnail bar is added to CoverSwitch. So you can also see all windows additional as thumbnails. In fact the thumbnail bar is taken from BoxSwitch effect and modified to fit into CoverSwitch. So if you wondered why I added animations to BoxSwitch effect, now you know πŸ˜€

So here’s a screenshot:
Coverswitch with thumbnail bar

Another new feature is taken from Cube. You can define the position where the covers should be shown. A kind of zoom. So it is possible to have the covers far away:
Covers far away
Or very near to the front:
Covers very near to front

It is not possible to zoom while CoverSwitch is activated, but there is a nice slider in the config.

None of these new features has hit trunk yet. It currently lives in the “coverswitch” branch in Zarin’s git repository. So if you want to give it a try just pull the branch. But of course I hope to have it ready for 4.2.

I’ll present a video as soon as I finished all my new features.

Animated boxswitch effect

Today animation support for boxswitch hit trunk. So you can enable animation like in the Compiz one. The animation is optional. So if you don’t like animations you won’t see it.

Well what is better to show new animations than a video?

For those who don’t like Flash or want to see a better version of the video

Hello to planet from wobblyland

Thanks to Jonathan Riddell my blog is added to planetkde as well. So I can help Lubos and Lucas to spread words about the development in wobblyland πŸ˜‰

Currently my development effort is a little bit stuck. I have an oral exam end of next week and don’t find time to do any real development. So there are several unfinished tasks I’m working on. Cube & co. is basically finished. If there is anything you are missing in Cube please give me a note so that I can add it for 4.2. I still know the code and adding new features is most of the times quite easy. I don’t know how this will be in half a year πŸ˜‰

So I started to work on the window switchers again. I’m working on a more Compiz like boxswitch effect with nice animations. And there are some ideas to improve CoverSwitch. Combining boxswitch with coverswitch and adding mouse interaction. Just the same here: tell me what you want and it can be implemented. I have not known that you can use mouse when use alt+tab. Never tried it, never thought about it. First noticed it when I tried to improve boxswitch.

So if you have ideas for cool effects or ideas to improve the effects: please tell us.

Back to learning πŸ™