Was passierte im Fenstermanager für KDE Plasma Workspaces 4.8?

Es ist schon ziemlich lange her, dass ich hier mal auf Deutsch gebloggt habe. Nun nehme ich unser bevorstehende Release der KDE Plasma Workspaces 4.8 als Anlass um mal darüber zu berichten, was sich so im Bereich des Fenstermanagers und Compositors seit 4.7, welches in Kubuntu 11.10 zum Einsatz kommt, so getan hat.

Unser nächstes Release wird Bestandteil der LTS Version, d.h. sehr viele Kubuntu und hoffentlich auch Ubuntu Nutzer werden lange daran Freude haben.

In 4.8 sehen wir im Fenstermanager nicht besonders viele neue Funktionen. Wir haben hauptsächlich “unter der Haube” gearbeitet. An mehreren Stellen haben wir die Performance verbessert. Das Vergrößern/Verkleinern von Fenstern läuft nun dank einer verbesserten Synchronisierung mit dem Zeichnen der Fenster flüssiger. Wer es ganz flüssig haben will, sollte weiterhin den Effekt dafür verwenden.

Unser Verwischen (Blur) Effekt hat besonders viel Liebe erhalten. Alle Zwischenergebnisse werden nun im Speicher vorgehalten und nicht in jedem Frame neu berechnet. Das hat enorme Auswirkungen auf die Performance. Dank dieser Verbesserung (und einigen anderen kleinen Verbesserungen im Compositor dafür) konnte ich problemlos auf einer etwas älteren Ati X300 einen Fensterstil einsetzen, bei dem alle Fenster mit verwischtem Hintergrund gezeichnet werden. Auch können wir nun den Hintergrund von herausfahrenden Popups selbst während der Animation verwischen. Bisher hatten wir darauf verzichtet um die Performance zu schonen.

Weitere Performanceverbesserungen wurden unserem Effektsystem spendiert. Die Effekte können nun sagen ob sie gerade aktiv oder inaktiv sind. Dadurch werden sie beim Rendern eines Frames nicht berücksichtigt. Dies führt zu einer besseren Skalierung: die Anzahl geladener Effekte und offener Fenster hat keine Auswirkung mehr auf die Performance, denn in der Regel sind nur ein oder zwei Effekte gleichzeitig aktiv.

Eine sehr interessante Entwicklung ist der Einsatz von QtQuick. Diese Technologie haben wir im Fensterwechsler (Alt+Tab) eingebaut und können dadurch sehr einfach verschiedenste Layouts unterstützen. Hier ermöglichen wir unseren Nutzer eigene Layouts zu erstellen und zu verwenden. In der nächsten Version wollen wir das weiter ausbauen um auch Get Hot New Stuff zu integrieren um weitere Layouts aus dem Internet herunterladen zu können.

Generell sehen wir in QtQuick sehr viel Potential und wollen dies in 4.9 verstärkt einsetzen um den Nutzern somit ein Werkzeug in die Hand zu geben um einfacher seinen Fenstermanager zu gestalten und die eigenen Ideen in die Entwicklung einzubringen ohne C++ beherrschen zu müssen oder KDE Plasma überhaupt bauen zu müssen.

Rückblickend bin ich mit der Entwicklung in 2011 sehr zufrieden und freue mich auf das nächste Jahr um die Früchte zu ernten von der Arbeit, die wir dieses Jahr begonnen haben. Ich kann nur jedem Nutzer empfehlen den KDE Plasma Fenstermanager in Version 4.8 auszuprobieren und mal neben Unity oder GNOME Shell zu versuchen. Dank der Flexibilität unserer Desktop Shell Plasma können Nutzer auch ohne großen Aufwand ihre bevorzugte Desktop Shell – sei es Unity oder GNOME Shell – nachbauen.

Aber damit 4.8 ein richtig tolles Release wird, sind wir auf eure Mithilfe angewiesen. Aktuell ist der Release Candidate 1 veröffentlicht und wir brauchen noch mehr Tester. Von Kubuntu gibt es PPAs um die aktuelle Entwicklerversion zu bekommen. Wenn ihr ganz sicher gehen wollt, könnt ihr auch Neon verwenden, das die Pakete getrennt installiert. Testet, findet die Fehler, meldet sie, damit wir Entwickler sie noch vor dem Release beheben können.

Und wenn ihr nicht wisst, was ihr mit dem ganzen Geld machen sollt, dass ihr zu Weihnachten geschenkt bekommen habt, so empfehle ich euch eine unterstützende Mitgliedschaft im KDE e.V. (Ich bin auch zahlendes Mitglied.) Dies ist ganz wichtig, denn mit euren Spenden werden die Entwicklersprints finanziert, welche wir Entwickler benötigen um die zukünftige Entwicklung zu koordinieren. Vielen Dank!

QML saved KWin Scripting

Over the last half year I blogged several times that I would drop KWin’s scripting component if nobody takes over the development of the code. Unfortunately up to now we have not seen any improvements. So keeping to my words I would have to drop the code.

Instead I decided to do a last try to get some work done and created some Google Code-In tasks and thanks to that the Tutorial and API documentation got imported to techbase. Example scripts are ready to be imported into kde-examples repository and we have received a KCM for managing the scripts. This is what I consider the minimal requirements for keeping scripting. Without an API documentation it’s just useless.

At the same time I have started to do my planing for the next development cycle. The main task of my work will be in the area of QML (surprise, surprise) with the aim to drop all custom GraphicsView code in KWin and replace it by QML. These are:

  • Remaining clean-up of TabBox: Desktop Switching needs to be ported, old code needs to be dropped
  • Aurorae is completely GraphicsView based and should be possible to be ported to QML. It will not just be a port of the theme engine, but will allow to write decorations in general using QML. One of the QML based decorations will then be an Aurorae theme interpreter. The long term plan for this is to get it into a state that it can replace the existing decoration API. Will need some time and some work together with Thomas and Fredrik – our decoration experts in KWin. The long term goal is to have it ready for the scene graph in Qt 5 and hopefully be able to integrate this very well with our compositor.
  • Desktop Change OSD: rather simple. Help more than welcome :-)
  • Desktop Grid and Present Windows: our effects which use widgets. Now this is the really interesting part of my 4.9 work. Desktop Grid and Present Windows will be ported over to QML and won’t be effects in the classic sense any more. I have been dreaming for years about having effects in a state that our UX designers could do them without hacking C++. Finally we are at the state where this is possible :-) As a nice side effect that will make it possible to use Present Windows even without compositing – an idea Lubos told me at my first Akademy in 2008.

All those areas somehow have to access KWin Core and at the moment all have different approaches. Decorations use a “bridge” between the Client’s and their decorations and partially direct function calls.

Effects have an EffectsHandler and EffectsWindow interface representing the Core functionality and working as a proxy. So very similar to the decoration bridge but with much more functionality.

Scripting on the other hand uses a “Wrapper” to export JavaScript functions and calls then the underlying Core objects.

For QML we would have to add Properties to all the functionality which we want to have exported. Which would be the fourth technology and one to many.

Yesterday I started to add the Property definitions to our Client class and ported KWin scripting to use the properties instead of the Wrapper for Client. It breaks existing scripts, but works quite nicely so far :-) For me this brings scripting finally in the area where it becomes useable to me: an easy way to test my property definitions.

So we can expect that scripting will get quite some love over the next development cycle. It will be tailored towards my developer needs which will help everyone.

But not only that. Given that we now have the properties, we can also base our Effect system on them. And Thomas did some great work on a generic effect implementation. So expect a second JavaScript API to write effects :-)

Exiting times are before us simplifying our development work and getting KWin ready for the next big step.

As I expect this to be my last blog post before Christmas I wish everybody a Merry Christmas and relaxing holidays. Thanks for using KWin and all the support I got this year for my work :-)

Bug reports for KWin from 2007 till 2011

What bug statistics can tell us

Over the last months I got the feeling that lately my mail folders related to “user issues” are not getting flooded any more. Now feelings are always very subjective, so I wanted to check whether there is some truth in my feeling. Over the same time I noticed that there is much more trolling against KDE for example on the dot.

One of my mail folders is for new threads about KDE in the German ubuntuusers forum. I have received notifications for new threads for quite some time, but the mails get deleted automatically. So I asked Christopher Grebs whether he could provide me the required information. So here is a plot showing the number of new threads per month over the last few years. As it is an (k)ubuntu related forum we can expect higher number of threads in April and October.

I included the year 2007 as it was the last year with only KDE 3.5 which many users seem to praise as the best desktop environment ever without any problems. What we can see here is that the number of new threads in 2007 (average 154) is similar to the one of 2009 (average 168) while 2008 was clearly a year causing trouble to our users. Kubuntu shipped 4.1 with 08.10 and there is a huge increase in November.

But what is really impressive is the decrease in 2010 and even more in 2011. So my feeling was right, there are less new threads. In fact in 2011 (please note that there is still half a month to go) the average new threads are just 63, which is less than half of what we had in 2007.

There can of course be many reasons for that. Maybe ubuntuusers is not any more so popular, maybe users go to forum.kde.org which did not yet exist in 2007, maybe Kubuntu is no longer a popular distribution for KDE users.

But it could also show that either KDE lost many users recently or that our software became much better, much better even than KDE 3.5 has ever been.

Now I thought how can I verify that this is not related to the forum in question and for that I wanted to look at our bug database and wrote a small tool to generate some statistics (if anyone is interested in the raw data please send me a mail). So here I present the number of opened bugs per month for KWin. As opened bugs I mean bugs which are either still open or have been fixed. Duplicates, invalid bugs, etc. are ignored.

Here we have a slightly different picture. Given our release schedule we expect higher numbers at end of year and mid of year. 2007 with KDE 3.5 hardly had seen any new opened bugs till the beta of 4.0 came around. Unlike in the forum 2008 is not the year with most reported bugs. KWin did not enable compositing till 4.2 (January 2009), so it was for most early adopters just the same as the 3.5 version. We can clearly see the enabling of compositing starting at end of 2008 with the high peak after the release in February 2009 and constant high values throughout the year. But already 2010 showed less newly reported bugs and in 2011 again my feeling is correct. Currently the curve is below the one of 2007 and the average is close to 2008 again (16 compared to 17 reported bugs per month).

Now this are two datasets validating my assumption. So let’s have a look at a third one: the number of opened bugs per month for Plasma. Here it is important to know that Plasma’s bugs are not as nicely triaged as KWin bugs, so it is likely that the number of bugs is just too high.

Here we can see the same as in the KWin case: 2009 was the high bug year and 2010 and 2011 much less new bugs. In 2011 we have an average of about 82 bugs/month compared to 80 bugs/month in 2008. This is an even more impressive trend than for KWin given that Plasma is much bigger and new concepts such as Netbook shell and many more applets were added.

Now given these datasets we can clearly say that our users find less bugs in our software. The only remaining question is whether this is caused by less problems or less users. For a source-code only distribution project such as KDE it is difficult to know how many users we have and we have to notice that very often the only feedback we get is the negative one. So it is difficult to say whether there are users with no problems or no users. But also for that question we can ask bugzilla:

This graph shows us all reported bugs against KWin including duplicates. The interesting value is the “Intel Peak” in May 2011. This driver bug affected Kubuntu users with Intel GPU and enabled unredirection of fullscreen windows. So although it only affected a subset of users and DrKonqui recognized the duplicates it’s the fourth highest value for the complete data set resulting in 2011 seeing almost as many bugs reported as in 2010 (832 vs 806) with still a big chance of 2011 surpassing 2011 as in each year more bugs have been reported in December than in November. We also see the problem of the Intel bug going away with the Kubuntu release of 11.10.

Now I generated some more graphs which show us some more data. Here we have a complete graph for all bug data of KWin over the time.

Again we clearly see the Intel Peak both in the reported Bugs and Reported Crashes. In general we see very nicely the DrKonqui induced bug reports. Whenever there is a peak in the reported bugs, there is also a peak in the reported crashes.

This we can also see in Plasma. It is quite clear that very few crashes affect a large userbase. As with the case in KWin these can be upstream. E.g. I’m quite sure that the last peak in the graph has been caused by a change in Qt 4.8.

Impressive is the beginning with all bugs being more or less fixed instantly during the development. There is one more interesting thing to be seen. Twice a year Aaron starts to panic about the number of opened bugs in Plasma and I think we can see this here as well. Let’s have a closer look at the fixed bugs:

Quite an impressing work the Plasma devs are doing there. Overall I think these graphs validate that there are less bugs and it shows how our software has matured over the years.

Experience from Porting Kickoff to QML

As mentioned last week I started to port Kickoff to QML as a training project. Now I am happy to announce that Kickoff with QML is functional and can already be used. If you want to give it a try, just checkout the kickoff-qml branch in kde-workspace and rebuild the kickoff applet. It does not overwrite the existing applet, but adds a second one called “kickoff” instead of “Application launcher”.
Kickoff QML Application View

As we can see in the screenshot Kickoff got connected to all the Models, so we can browse all the tabs, the applications and perform search.

The actual idea was to just do some QML training, but it turned out to be more a training on Qt Models. The Kickoff code is let’s call it interesting. All the tabs have an underlying Model, but what was really surpising is that all Models have a tree like structure. For the Applications Model this was to be expected, but why are the Favorites in a tree structure? As QML is still rather limited for Tree Views I changed the favorites and leave model to be a plain list model which makes it easy to use.

The systems model (applications, places and removable devices) turned out to be more challenging. It uses a QProxyModel instead of QStandardItemModels and merges the applications and places into one Model again in a tree structure. Changing this to no longer being a tree structure seemed non-trivial and I did not want to touch the C++ code. So I started to implement a Tree view in QML for the system tab. Finally I had the QML code to play around with to improve my skills.

After I succeeded in rendering a tree view I noticed a new problem: both places and removable devices showed the same entries and too many entries. It took me quite some time to figure out the problem: the Model is buggy. The proxying was not done correctly and the view so far filtered out entries not relevant to the current section – ouch. This I could not copy in QML as the row count of the Model would not match the count of shown entries resulting in wrong height calculations.

So I had to fix the Model and was back doing C++ programming. Now the Model correctly proxies the underlying Model and I can use the standard views in Kickoff as it is also no longer a tree structure. All my work on the tree view in QML was in vain *sigh*.

Last but not least I had to face the recently used Model. Like all the other Models it has a tree structure. After the experience with the Systems Model it was clear to me that I have to rewrite it as well.

After that the last remaining task was to integrate the search and finally a Model which worked exactly the way I expected it to be. Exported the Model to QML, connected the search field and there were search results. Thanks Ivan for the great job of providing a working Model without having to first fix it.

The results of the work look really promising. Kickoff is much faster, all Models are lazy loaded, that is they get only loaded if the tab is selected. So there is no delay any more when clicking the Kickoff button in the panel :-)

Of course there is still lots of work left for me to train my QML skills. Drag’n’Drop support is missing, context menus are missing. We need some nice animations. But of course there is still lots of time till master opens up.