KWin enters the world of QtQuick 2

Since my last blog post there has been lots of progress on the KWin on 5 effort. First of all a big thank you to everybody who has picked up some of the tasks on the trello board. Thanks to that the compile output is starting to look better and better – the number of deprecated warnings is starting to go down and by that also some areas are closer to be working again.

Talking of working again: the important changes are merged into Qt with the result that KWin from framework-scratch branch starts again. One should still be careful and not replace the KWin 4 – the most important steps are outlined in the wiki.

Lately my work focused on porting from QtQuick 1 to QtQuick 2. This is a change which needs to happen as all our user interfaces are using Plasma Components which do not exist for QtQuick 1 anymore in the frameworks 5 world. Of course we also want to make use of the new goodies of QtQuick 2 ūüôā

This required not only to adjust our QML files, but also to change the C++ side from QtDeclarative to QtQuick. I was a little bit afraid of these changes as our window thumbnail rendering used quite some hacks around the underlying QGraphicsScene to make it work. My fear was that this won’t be possible with QtQuick 2 anymore.

To my surprise I was even able to remove a large part of our hacks because QtQuick 2 exposes information which we need and which isn’t exposed in the old world. Other parts are still hacky and I fear that we even have some regressions concerning clipping.

Our QtScript and QML bindings shared a lot of code as both are based on QScriptEngine. With QtQuick 2 it’s no longer based on the QScriptEngine and by that our implementations start to diverge. As far as my testing showed we can no longer inject properties on the JavaScript global object in the QtQuick bindings which means that our API slightly breaks and cannot be identical to the QtScript API any more.

While this is of course a disadvantage it also brings advantages as I am forced to implement proper QML replacements. For example interaction with a screen edge can now be done in a nice QML syntax:

ScreenEdgeItem {
    edge: ScreenEdgeItem.LeftEdge
    onActivated: doSomething()

Right now all usages of QtQuick in KWin core and KWin effects have been ported to QtQuick 2. Still remaining is Aurorae – this needs some more work as the window decoration API needs adjustments anyway given that right now rendering of decorations in non-compositing is broken.

Release Party in Stuttgart this Friday

This Friday (16th) there will be a release party in Wirtshaus Troll in Stuttgart starting at 19:00 to celebrate the awesome 4.11 release of the KDE SC. For more information (also about other release parties) check the Wiki

If someone else wants to go from Rhein-Neckar area to Stuttgart please leave a note.

FLOSS after Prism: Anonymity by default

In my last blog post I discussed that we have to protect the user’s privacy better by giving the user the choice to decide which data gets submitted to services. In this blog post I want to share some thoughts about the case that the data is submitted and how to protect the user in such a case.

There are of course many legit online communications done by our systems. They should check for security updates, a weather applet might want to check the latest weather for the place you live in and so on and on. While this is obviously data the user wants to be submitted, the process of submitting the data is concerning from a privacy point of view. While it is in fact just meta data, it is telling a lot about the person.

Let’s just look at system updates and what they tell us:

  • Unique identification of the user through IPv6
  • Location of the user through the IP address
  • Identification of the used operating system (e.g. asking debian for updates implies you use Debian)
  • Interval in which the system is used (e.g. daily updates)

This is a rather threatening set of data especially if I think about that some proprietary software installed additional sources.list entries on my system (Google and Steam) without ever asking me.

But there is an easy way to protect the user’s privacy in such cases through anonymity. With the help of the Tor project it is possible to completely hide the information listed above. If the user cannot be uniquely identified any more, the information which can be derived from that gets lost. And that is a good thing.

Of course any user could just install Tor. But let’s face it: it’s difficult and complex and the user needs to know that Tor exists in the first place. It’s a nice solution for informed people like me, but certainly not for the vast majority of people for whom we develop free software.

So it is up to us to improve the situation. Why not integrate Tor (or similar services) directly in our products? For data like the weather applet it could just sent all requests through Tor and by that help to protect the users. Yes it requires more work from us developers, but in the end we are the only ones who really can decide whether it’s useful to use Tor for a given service or not. Let’s face it: for a Facebook status update applet using Tor is rather pointless. So let’s use anonymity where it is possible, where it makes sense and let’s integrate this information into the privacy center I proposed in my last blog post.

FLOSS after Prism: Privacy by Default

The disclosures by Edward Snowden will have a huge impact on our society and by that also on free software. I do not think that we can continue as we used to do, but that we have to adjust our software to fit the new reality, to make our software a true opponent to the surveillance state we live in and to return to 1983.

I have been thinking about what floss can do to protect the people and I want to share my thoughts in a few blog posts. Today I want with this first blog post talk about the fifth freedom:

“The freedom to decide which data is sent to which service”.

As we all know free software offers us the four freedoms. Those are important but they cannot protect the user’s privacy. Unfortunately there is free software out there, which is violating the above fifth freedom. There is software out there which is able to track you, there is software out there which sends all your local search queries to third parties like Amazon, there is software out there which allows to turn your smartphone into a surveillance utility. Thanks to the four freedoms we are able to see that software is doing this but the user has no chance to change it. Yes the four freedoms allow a user to modify the source code, but in practice a user normally cannot do that. Even users who are skilled can only protest.

I know that many users think that it doesn’t matter, because they have “nothing to hide”. But I disagree – I have lots to hide and I am sure that everyone has things to hide. And even if it is not about our private life there are lots of occupation with privacy being a central part. Yes, it’s the job of a lawyer to hide. If a lawyer is not able to use floss software because he cannot even open a client’s file without Amazon and any connected third party (e.g. Tempora) knowing about it, this is a clear violation of the first freedom which forbids discrimination of users.

Given that we have the above fifth freedom which is directly derived from the four freedoms and highly inspired by Germany’s right for informational self-determination:

… in the context of modern data processing, the protection of the individual against unlimited collection, storage, use and disclosure of his/her personal data is encompassed by the general personal rights of the [German Constitution]. This basic right warrants in this respect the capacity of the individual to determine in principle the disclosure and use of his/her personal data.

With informational self-determination every user has to be always aware of which data is sent to where. By default no application may send data to any service without the users consent. Of course it doesn’t make sense to ask the user each time a software wants to connect to the Internet. We need to find a balance between a good usability and still protecting the most important private data.

Therefore I suggest that the FLOSS community designs a new specification which applications can use to tell in machine readable way with which services they interact and which data is submitted to the service. Also such a specification should include ways on how users can easily tell that they don’t want to use this service any more.

With this information provided applications can start to add first run information to tell the users how they interact with services and how the users can configure this.

Furthermore a complete database of all the services would allow to introduce a privacy center directly in the user’s desktop. A center listing all the applications which interact with remote services, a center where the user can directly disable certain services.

Of course there is still one problem: how to force applications to make use of it and to provide all the data. Such a center becomes useless if some applications do not implement it, because it thinks its user are a product which they need to sell. But this is a social problem and we cannot solve social problems with technical merits. If a FLOSS product is violating the user’s privacy we all have to call out and convince the project that this is a bad idea. It’s up to the users to not use software which is violating the user’s privacy and by that force the project to change.

Update: See also the follow-up post FLOSS after Prism: Anonymity by default

Thoughts about Internet Surveillance

This blog post is not directly KDE related, but is about freedom in the broader scope. Obviously like all my blog posts this post only represents my personal opinion and not of any organization I am a member of.

Privacy has a long tradition in modern Germany. In 1983 the German government wanted to organize a census and drafted a law for this census. People protested against this law in front of Germany’s highest court Bundesverfassungsgericht (“federal constitutional court”). The court did not only stop the census but went much further and did something which has never happened before in German history: the court created a new civil right directly derived from the other civil rights. The civil right on “informationelle Selbstbestimmung” (“informational self-determination”). I quote verbatim the new civil right directly from the verdict:

Das Grundrecht gew√§hrleistet insoweit die Befugnis des Einzelnen, grunds√§tzlich selbst √ľber die Preisgabe und Verwendung seiner pers√∂nlichen Daten zu bestimmen. (in English: “This basic right warrants in this respect the capacity of the individual to determine in principle the disclosure and use of his/her personal data.”)

Furthermore I want to quote one part of the verdict as it’s rather important in the current discussion about governmental surveillance:

Wer nicht mit hinreichender Sicherheit √ľberschauen kann, welche ihn betreffende Informationen in bestimmten Bereichen seiner sozialen Umwelt bekannt sind, und wer das Wissen m√∂glicher Kommunikationspartner nicht einigerma√üen abzusch√§tzen vermag, kann in seiner Freiheit wesentlich gehemmt werden, aus eigener Selbstbestimmung zu planen oder zu entscheiden. Mit dem Recht auf informationelle Selbstbestimmung w√§ren eine Gesellschaftsordnung und eine diese erm√∂glichende Rechtsordnung nicht vereinbar, in der B√ľrger nicht mehr wissen k√∂nnen, wer was wann und bei welcher Gelegenheit √ľber sie wei√ü. Wer unsicher ist, ob abweichende Verhaltensweisen jederzeit notiert und als Information dauerhaft gespeichert, verwendet oder weitergegeben werden, wird versuchen, nicht durch solche Verhaltensweisen aufzufallen. Wer damit rechnet, da√ü etwa die Teilnahme an einer Versammlung oder einer B√ľrgerinitiative beh√∂rdlich registriert wird und da√ü ihm dadurch Risiken entstehen k√∂nnen, wird m√∂glicherweise auf eine Aus√ľbung seiner entsprechenden Grundrechte (Art 8, 9 GG) verzichten. Dies w√ľrde nicht nur die individuellen Entfaltungschancen des Einzelnen beeintr√§chtigen, sondern auch das Gemeinwohl, weil Selbstbestimmung eine elementare Funktionsbedingung eines auf Handlungsf√§higkeit und Mitwirkungsf√§higkeit seiner B√ľrger begr√ľndeten freiheitlichen demokratischen Gemeinwesens ist.

I am sorry that I cannot translate this into English. To paraphrase it says that if you don’t know who has which data and whether the government will gather data about you, you will stop to do certain actions and you will no longer go to demonstrations for example – it describes the chilling effect. The court acknowledges that this renders a high threat for overall democracy. To put it in the context of our current global surveillance situation: I did consider whether it is safe to click links to the guardian as I can be sure that this will be registered and by that I render the risk that I might not be allowed to enter the US the next time I want to travel to the US.

Although this civil right never entered the “Grundgesetz” (Basic Laws – the German “constitution”) it is very important and clearly influenced the German society over the last three decades. For example if you sign up to a new service you always have to sign a privacy policy telling you how the service is going to make use of your private data. You always have to opt-in to newsletters, etc. – it’s never an opt-out. My major during my studies was IT security and this was not just about how to protect data, it was also about how to protect the privacy of your users. The main idea is that you don’t gather private data you don’t need in the first place (“Datensparsamkeit” and “Datenvermeidung” – “data reduction and data economy”). During my studies we once had a lecture in which the (non German) tutor wanted us to implement an e-shop which tracks where the user clicked and store it per user. The complete class protested because that would violate the user’s right of informational self-determination.

To make another bridge to the current surveillance discussion I want to fast forward to the year 2010 and again the Bundesverfassungsgericht has an important role. Germany had established as demanded by the European Union a data retention system which stored for half a year meta data about telephone calls and internet communications (ip addresses, email headers, etc.). As it’s rather obvious this conflicts with the right for informational self-determination and people protested against this law at the Bundesverfassungsgericht. For the first time it was not just one or a few persons but 34,939 people protested against this law in front of Germany’s highest court. The reader of this blog post might not be surprised, that I was one of those. The verdict was very clear: the law is violating Germany’s constitution and is void. The telcos had to delete all data gathered up to this point immediatelly. In the tradition of the ruling of this court this was a rather strict verdict – normally the government gets some time to improve the law and it only becomes void after some time passed if the government doesn’t improve the law to make it suit the constitution. Although the EU demands that we have the data retention no new law got drafted – after the current NSA scandal, I do not see a chance even after the elections.

Again I want to quote the verdict verbatim:

Die Vorratsdatenspeicherung erm√∂gliche Pers√∂nlichkeitsbilder mit einer noch nie dagewesenen Genauigkeit. Die Kommunikationsdaten seien inhaltlich √§u√üerst aussagekr√§ftig. Der Zugriff auf die n√§heren Umst√§nde der Telekommunikation wiege nicht weniger schwer als der auf den Kommunikationsinhalt. Er erm√∂gliche umfassende Pers√∂nlichkeits- und Verhaltensprofile. Verkehrsdaten lieferten eine Vielzahl von Informationen √ľber soziale Beziehungen.

Die Vorratsdatenspeicherung erh√∂he au√üerdem das Risiko, zu Unrecht Ermittlungsma√ünahmen ausgesetzt oder unschuldig verurteilt zu werden, und die Gefahr des Datenmissbrauchs. Verkehrsdaten k√∂nnten gezielt gegen missliebige Personen eingesetzt werden und eigneten sich zur Kontrolle von Personen und Gruppierungen ebenso wie zur Wirtschaftsspionage. Nur das Absehen von der Datenspeicherung sch√ľtze wirksam vor Missbrauch.

An attempt for translating to English (German readers are encouraged to provide improvements to the tranlation in the comment section):

Data preservation allows to create a picture about a personality with a precision which has never been possible before. The data about communication is with regards to content very significant. The access to the meta data about communication is not less severe than the direct access to the content of the communication. This access allows to create broad profiles about personality and behaviour. Telecommunication meta data provides lots of information about social relations.

Data retention also creates the risk to wrongly become a suspect of preliminary proceedings and to be innocently convicted as well as the risk of abuse of data. Meta data can be used directly against personas non grata and can be used to control persons and groups as well as be used for economic espionage. Only not storing the data in the first place protects effectively against abuse.

I have huge respect for the wise decisions of our highest court and how they are able to see the dangers of governmental surveillance for the people and the democracy. Also the court appoints great experts like for example the German Chaos Computer Club. One of the experts appointed by the court was the superviser of my master thesis and I attended a few lectures (e.g. Operating Systems, IT security, IT forensic) at his institute.

The discussion about the verdicts of the Bundesverfassungsgericht needs to include one further verdict from 2008. People protested against a law in the German state North Rhine-Westphalia. This law allowed the secret service of the state to secretly observe the Internet (it sounds quite like what we are currently discussing). Like 1983 the court did not just dismiss the law but also drafted for the second time a new civil right in its verdict: the civil right for “Gew√§hrleistung der Vertraulichkeit und Integrit√§t informationstechnischer Systeme” (“Warranty for confidentiality and integrity of IT systems”). The court made it quite clear when the government is allowed to do Internet surveillance. There must be an actual evidence for a concrete danger against a protected interest of paramount importance. With other words just saying “but the terrorists” is not a concrete danger to spy on all your people. Also any violation of this civil right must be signed by a judge. The verdict also makes clear that the Internet as such is considered as an IT system and that it is a central part of the life of many citizens.

As you see the protection of private data in the Internet is protected by several civil rights in Germany. Two of them have been crafted by the German constitutional court – so to say the German people had to fight for these rights. I personally consider these rights as to be of paramount importance because we had to earn them first. Also this discussion should show that the German government also tried to limit our rights and to establish Internet surveillance but that we as the people are able to fight against such illegal laws and forbid the state to do so.

I am not willing to surrender and give up these essential freedoms. I do not tolerate that foreign governments are limiting my civil rights in Germany with Internet surveillance in a way or even more severe than what our constitutional court forbid our government – I fought against data retention a few years ago after all. Given the latest discussion it seems like Level 3 Communications is doing the espionage in Germany for the US government (given some reactions by Level 3 it is considered that they already claimed guilty – they do not permit access to foreign governments). This is not just violating our civil rights, it is also forbidden given German penal law. We have the so-called “hacker laws” which forbid to access third party data. While writing this blog post I am listening to radio and the news told me that the German federal prosecutor office is considering to start preliminary proceedings in the case NSA. I do hope that this will end up in convictions against the persons responsible for this in Germany and if possible even in the UK, USA and any other affected state.

I hope that everybody fights for their freedom. We should not tollerate that in the name of terrorismn our civil rights are limited. I am not a terrorist and there is no reason to track all my online communication in the fight of terrorismn:

They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.

Especially to my readers in UK and USA: fight for our rights. Do not tollerate that your government is spying on people of other countries. We are not second class humans! Help us! Fight for us! Protest against your government! Fight for our freedom, fight for your freedom! Not even 23 years ago part of the German people had to live in an Unrechtsstaat with strong surveillance of the people by the Ministry of State Security. Former members of the Stasi say today that they would have loved to have the capabilities the NSA has today – it’s some food for thoughts. If you want to get a feeling about what surveillance means I highly recommend to watch the excellent Academy Award winning movie The Lives of the Others.

Next step: running

Last week I reported that KWin compiles and links against Qt 5 and KF 5. This week I’m glad to report that I got KWin also to run. The biggest issue was a PEBKAC – if you try to run anything build against frameworks make sure to not have KDE 4 libraries in your LD_LIBRARY_PATH.

Aus KWin

Before you are tempted to run KWin next in the new Project Neon setup a word of warning: it will dead lock. The current code base I use for testing depends on not yet upstreamed changes in frameworks and Qt. Obviously I have not yet pushed the KWin code needing these library adjustments but without them KWin will hit a dead lock – more to that explained later on.

Project Neon has been a huge help over the last days. Harald reported again and again build issues which we were not able to detect on our system because we also have Qt 4 installed. One example was a file being included which does not exist anymore in KF 5. As it was installed in /usr/include I was not able to detect such a problem, but with a clean setup like Project Neon it becomes immediately obvious.

So what is already working in KWin on 5? The most obviously visible one is the compositor. This doesn’t surprise me much, I didn’t expect any problems there. So far I have mostly tested the XRender compositor as I’m currently mostly working with Xephyr which only provides llvmpipe OpenGL and I rather spent my CPU cycles on compiling than drawing triangles. Since yesterday I have also Oxygen shadows working again which I had initially disabled as it needed XCB porting. But it just looked too strange without them, so I had to enable it ūüėČ I think Hugo ported Shadows in Oxygen for the same reason.

Related to the compositor is the effect system and our effects. This was rather surprising for me: they just worked out of the box. The only major problem is that global shortcuts are not yet supported so I have problems triggering them. For some effects I solved this problem by just adding a DBus interface – might be an idea to keep this; some users might appreciate it. Only the scripted effects were not loaded because I did one mistake during the initial porting – this is fixed since today as you can see by the dialog parent effect being applied in the screen shot above.

Also window decorations work, though there is still quite some work to be done. For example the QML based Aurorae does not like to work which is the reason why I ported Oxygen over. It’s overall nice to see that it works, but it seems to be only working with compositing enabled. Not so surprising as this hits areas which changed a lot inside Qt.

The window manager seems also to be working, though obviously I have not tested all features and are using only a minimal sub set of the available functionality. Due to missing global shortcuts support it’s difficult to test all features and due to missing port of the configuration interfaces I cannot even adjust the configuration (well I could just edit the config file, but…).

Nevertheless there are still quite some issues which need investigation and fixing before I can start to consider using KWin 5 in production. The biggest problem at the moment is that all windows present at startup get unmapped and are kind of lost to the window manager. So far I have not yet been able to figure out why this is happening. That is for example a show stopper if you would want to use it in a neon setup. (Update: This issue is fixed as of 3bddd1100aa)

The biggest change for KWin is the port of the event filter from XLib to XCB and this is still causing some headaches to me. With XLib one was able to look into the future by inspecting the XEvent queue or to the extreme wait till a specific event has arrived. With XCB the event queue doesn’t allow to be inspected which makes porting properly a non-trivial task. KWin was using this functionality at three places (at least that’s what I found so far). During move/resize operations we only process the last mouse motion event currently in the event queue to limit the resizes. This functionality should be possible to emulate with a more async event handling approach. The second usage is that we do not deactivate a window on focus out event if there is also a focus in event following. The documentation says this is to prevent flickering. In a composited world it doesn’t really matter as the compositor should prevent the flicker, but also here a more async approach should be able to handle it.

The big problem though is the third usage: updating the current xTime. KWin needs to have the most recent X time to be able to properly compare timestamps. This is done by changing a property and waiting for the event which contains the timestamp. In addition KWin does some more tricks like looking at the first event in the queue containing a timestamp, to get it really correct. Now with XCB event queue not being available to us this is a sever issue as without this functionality KWin doesn’t function properly. While looking at how to solve the problem I discovered that the XCB QPA internally uses a method providing this functionality of getting a current timestamp. Not with all the bells and whistles as we used to have in KWin, but good enough for a start. So my solution at the moment is to have my local Qt copy to make this function available and by that solve the problem. That’s the change I talked about in the beginning of this blog post.

As you can see there has been quite some progress and I hope to get KWin in a dogfoodable state quite soon. And that’s something where you can help. There are many easy tasks available which just need you to be able to compile KWin and with Project Neon this just became easier. So drop by the Trello board and claim your task. This week I was already able to push one first time KDE commit with a small cleanup for our code base ūüôā So who wants to be next?

KDE – the Prism Breaker

In times of prism, tempora and xkeyscore we have the good chance to differentiate our products as the true prism breaker

I just sent this to a KDE mailing list. And it’s true. The KDE Community’s software is:

  • community controlled, no US-controlled company can introduce “patriotic” changes
  • majority of developers are based outside the US, many in Europe and India (@devs: please provide your data for commit digest, 20 % unknown is too much)
  • our legal entity (KDE e.V.) is Germany based
  • we don’t send any of your data to our (or third party) servers (but you can opt in to shop in Amazon store in Amarok)
  • we provide software to encrypt and protect your communication (KMail, KGpg, Kleopatra and Kopete with OTR plugin)
  • we provide web browsers (rekonq, Konqueror) which are not controlled by an US corporation or US foundation
  • we provide a web browser rendering engine (KHTML/KJS) which is not controlled by an US corporation or US foundation
  • we live open standards with for example excellent ODF support (Calligra suite)
  • we provide a tablet operating system (Plasma Active) following the principle outlined above

And much, much more. If you are concerned about Prism & co consider using KDE software. For a full list of software also check out PRISM ? Break which also gives nice explanations why you shouldn’t use some free software.