Help porting KWin to Frameworks 5

With Akademy behind me and the situation about “what is master” in kde-workspace resolved I decided to switch my work away from Wayland towards getting KWin on top of Qt 5 and KDE Frameworks 5. After a few days of hacking the compilation of KWin is re-enabled in the frameworks-scratch branch of the kde-workspace git repository.

This means that KWin compiles, links and installs when compiling against KF5. A quite important step and only very few code areas got ifdefed. The preparation work of the last months showed it values as for example the compile errors due to QPixmap were extremely easy to resolve (just delete the code) without loss in functionality.

But of course at the moment KWin does not work yet when compiled against KF5 as the event filter is not yet ported to xcb. This is what I will focus on next so that we can soon start testing a KWin on 5 and start to adjust the areas which need to be tested against a running KWin, where “ship it, it compiles” is not enough.

Of course getting KWin to KF5 is still a long road and we need help for this. There are many, many tasks which are rather easy and do not need a working KWin. It’s just a matter of changing for example KPushButton into QPushButton and verify that it still compiles. This means that right now is a perfect time to get started with KWin hacking.

And obviously I started to prepare for that and created a wiki page for KWin on Frameworks. I plan to update this page whenever new information becomes available like how to run KWin on 5. Most important I created a Trello board listing the tasks which can be done to help the porting. I will add tasks as I notice them. So if you want to get involved, just ping me, tell me your trello username and I’ll add you to the board and start hacking. If you look at the list you will notice that some tasks are really simple. Let’s rock to get KWin working on Qt 5 as fast as possible to get an awesome next release.

Akademy Impressions

Yesterday evening I returned from this years Akademy which means that today is a perfect time to reflect some of the impressions.

Overall I think this was one of the best Akademies I have attended so far. The atmosphere was just great, the location was overall quite good and the weather was awesome.

Akademy started for me at Friday with the AGM of the KDE e.V. It was a very interesting AGM. I think it was a good decision to move the AGM to Friday and hope that also next year will be like this. If you are interested in more about the AGM, just read Mirko’s blog post. A small reminder: if you are a supporting member of KDE e.V. you are allowed to join the AGM, but without voting rights.

On Saturday and Sunday we had the conference with the talks. I myself had 1.3 talks – the Quality talk I shared with David and Vishesh. Once the recordings are available I recommend to watch it as it also addresses the shorter release cycle discussion and why I think that this would improve our quality. Speaking about the shorter release cycle: we had a very constructive BoF later the week and I think we found a very good compromise to move forward.

The keynotes were overall quite good, I was especially interested in the Jolla keynote. But also Kevin’s keynote about the KDE democracy is worth watching. Quite interesting was the discussion about “Respect the elders” and what makes up a KDE project. That we discussed that the Linux kernel could not be a KDE project because of their bad mailing list communication skills is quite a saying. As if we would have known that LKML would become a big topic a few days later.

The most interesting talks from my perspective were of cause the technical ones. I really enjoyed Volker’s expression template talk covering the topic of implementing domain specific languages with the help of C++ meta programming. Also Milian’s talk about improving the performance of C++ is something you should watch if your application is critical (also if not). KWin already gained the first improvements thanks to this discussion. And more will follow.

The conference ended with the Akademy Award ceremony. I am quite happy with the decision the jury took – especially given that I thought about two of the winners last year when I was a member of the jury. So to say we chose a good jury last year ;-)

What made me really happy at this years Akademy is that we are broadening our scope. This year we had talks about Mer and Razor Qt and like last year members of the VideoLAN project were around. And of course there was the Qt Contributor Summit co-hosted on Monday and Tuesday – though I did not attend any discussions.

Instead I spent most of Monday at the Kubuntu BoF and tried to give some useful feedback from an upstream perspective. And also of course my personal opinion like I would love to see Debian KDE and Kubuntu packagers to work more closely together. During this BoF we got an overview of the LiMux project of the city of Munich. It’s great to hear that we will soon have 15.000 KDE SC 4.11 installations, but this will take some more time – enterprise setups move rather slowly compared to us ;-)

On Wednesday we had the release cycle BoF. I think the outcome is really good and I hope that the community agrees to trying this out. So far the discussion had been very positive and I am really happy that we can get in all the stakeholders. That distributions can share their opinion just as an equal is quite a positive sign that the communication between upstream and downstream is really good in KDE. In fact for quite many distributions I am not able to say if a developer belongs more to KDE or more to the distribution.

In the afternoon we had the day trip to the sea side. Thanks to that I can check the box for “swim in sea once a year” for 2013. In the evening we had a wonderful meal before heading back to the hostel.

On Thursday we had a Bof on Plasma Active, but apart from that I did not attend any further BoFs as I had to head to the airport in the late afternoon. Travel back was quite smooth and way better than the travel to Akademy. I almost missed my flight because the 30 min travel from Mannheim to Frankfurt Airport took 90 min with Deutsche Bahn. On the positive side I did not have to wait for the security check ;-)

Looking forward to next years Akademy wherever it will be.

An unexpected journey

Since my last post quite some progress has been made in getting KWin working on top of a Wayland compositor. My main focus of work has been on the input stack. This is something I am not really familiar with as so far we did not have to care about it.

As some might know input handling in X11 is very insecure. Every application is able to listen to every key event. And in the KDE workspaces we obviously make use of these “features”. For example the global shortcut handling is implemented as a kded module listening to all key events and notifying the application via D-Bus that the shortcut got triggered. In a post-X11 world this will not work any more: applications are no longer able to listen to all key events.

One of the important tasks therefore is to not send all input events to the
X-Server but just to the window which should get it, or to handle the input events inside KWin and discard them without passing to the applications. My current branch already supports activating screen edges and using fullscreen effects like Present Windows completely without passing the input events through X. This means that some of the longstanding issues are automatically resolved. We no longer “steal” the screen edges from applications and starting the screen locker should be possible even if present windows is active (not tested and still needs some screen locker support in KWin).

But this also means that features like the global shortcut handling start to break. Mostly because kded is not listening on my virtual X but that’s just detail ;-) So I also had to start working on global shortcut support inside KWin – otherwise I would have had a hard time to use some of the important features like switching desktops or using Alt+Tab. At the moment the latest code only supports KWin’s internal shortcuts, but global support for kglobalacceld will have to follow. We had some ideas on how to improve global shortcut handling in general anyway.

When the infrastructure was in place I couldn’t resist the temptation to work on features which had been requested for a long time and were not really possible to do with X11 (or only with huge hacks): mouse shortcuts. Ctrl+Alt+left click activates desktop cube. But that’s not enough. While sitting in the Kubuntu Developer Summit I added also mouse wheel support which allows us to ctrl+alt+wheel to switch desktops and also to use the zoom effect. This work can be found in branch kwin/global-shortcuts on my personal workspace clone.

I hope that we will soon have a decision on the “what’s master” discussion and I can start merging the changes in. Once this is done I plan to switch focus to the Qt 5 port and concentrate on this for the next few weeks.

Nevertheless this should not be a reason to stop the work on the Wayland efforts. There are so many small things which can be done and lots of low hanging fruit. I will try to setup a trello board with a few tasks, so that interested developers could start picking up some easy tasks and get their hands dirty. Once something is in place I’ll write another post.