Skip to main content

How platform integration in Qt/KDE apps works

There has been some recent discussions about how KDE applications (or Qt apps in general) should look and feel like outside of the Plasma desktop, particularly in a GNOME environment.

During this discussion I noticed two major disconnects between the involved parties. One of them is technical in nature, where (understandably) not everyone involved has deep knowledge about how Qt and KDE apps work. The other one is cultural in nature, where there’s opposing views about who gets to decide how an application should look and feel like on a given platform.

A month as KDE Software Platform Engineer

Precisely one month ago I joined KDE e.V., the non-profit organization behind KDE, as Software Platform Engineer. This is part of three positions in KDE’s “Make a living” initiative.

The exact scope of this position is a bit vague. I like to describe it as “Taking care of everything needed so that people can build and enjoy awesome software”. A large part of that is taking care of foundational libraries such as Qt and KDE Frameworks, but it can be really anything that helps people do awesome things. This is pretty much what I’ve been doing as a volunteer for the last couple of years anyway.

Generating Dependency Data for kdesrc-build

As you may know KDE consists of many different subprojects, where some projects depend on other projects. Most KDE projects depend on some KDE Frameworks, but other dependencies are also possible, e.g. plasma-desktop depends on plasma-workspace. To be able to automate building projects (for the CI system or tools like kdesrc-build) you need a machine-readable source of dependency information.

For a long time this information has been available in a set of files in repo-metadata. To declare for example plasma-desktop’s dependency on plasma-workspace one would write the line

KDE Eco Sprint 2022

Last weekend, on May 21st, some people (including me) met in Berlin for what I believe is the first in-person KDE sprint since you-know-what happened (there was LAS, but that’s not technically a KDE sprint). We met in KDAB’s office, which was incidentally also the location of the last in-person sprint before unamed things happened.

A group photo of nine people Photo by Joseph P. De Veaugh-Geiss.

During the sprint we set up a measurement lab for the KDE Eco initiative. Our goal is to make it as easy as possible for application developers to measure the energy consumption of their applications. To do this a stable and reliable measurement system that is available over a long timespan is needed. KDAB kindly offered to host such a system in their office.

Task Manager Improvements in Plasma 5.24

In my last post I talked about why knowing the desktop file for a window is important for the task manager. I promised to talk about some cool stuff we did there in Plasma 5.24, so here we are.

While hacking on the task manager code I noticed that we show a “Open new instance” action in the context menu of every task manager entry, even for those where it doesn’t make sense. A lot of apps are inherently single-window or single-instace, i.e. launching the app a second time will not open a second window but rather focus the existing one. Also, not all windows actually belong to a user-facing or user-launchable application. For example the network integration might ask you for the WiFi password, but you can’t open a new window for that from the task manager. Another kind of app where this actions doesn’t make sense is helper applications like the wizard for connecting to a new bluetooth device.

The importance of window to desktop file mapping

In my last post I talked about what application developers can do to fix their applications not showing up correctly in Plasma’s task manager. I motivated this by the fact that we need this on Wayland to display the app’s icon. However icons are not the only reason why correctly mapping windows to desktop files is important. It brings substantial benefits even on X11:

  • Application titles: In addition to showing the window title Plasma’s task manager also shows the application name (the Name key in the desktop file). If the desktop file can’t be determined it falls back to the executable name, which isn’t particularly nice.
  • Jumplist actions: Desktop files allow apps to specify additional application actions. For example Firefox allows you to open a new window or a new private browsing window by right-clicking on the entry in the task manager.
  • Media player controls: Plasma’s task manager allows to control application’s media playback. You can e.g. pause a music player by right-clicking on its task manager entry. For this to work the window has to be matched to the MPRIS player instance, which happens based on the desktop file name.
  • Recent files: Plasma’s task manager shows you recently used files for an application in the context menu for an application and allows to open that file in the app. This also relies on the desktop file mapping.

Now that we established why it is important to map a window to a desktop file, how is it done?

Fixing Wayland taskbar icons

A common papercut in a Wayland session is entries in the task manager showing a generic Wayland icon instead of the proper application icon. Here’s a KWallet window having a generic icon in the task manager (on the right):

Task manager with generic Wayland icon on the right

This is due to the shell not being able to properly map a window to an application. This breaks more things than just icons, but those are often the first thing that is noticed. Fortunately this is usually very easy to fix, particularly for Qt/KDE apps. I fixed a couple of those over the holidays and now I am writing down what needs to be done so you know what to do the next time you encounter such a case.

FOSDEM & Plasma Mobile Sprint

Last week I decided to take KDE Itinerary for a test tour. Between the train rides there was also time for some KDE stuff.

FOSDEM

After writing an exam on Friday afternoon I took a train to Frankfurt. I did so not to enjoy the beautiful scenery of the area around Frankfurt central station at night but to be able to catch an early train towards Bruxelles for my first time at FOSDEM.

KDE Frameworks 6 sprint

Last week I took a train to Berlin for the KDE Frameworks 6 kickoff sprint. A lot has been said about it by my fellow attendees already, so I won’t go into detail much.

Work on Qt 6 has begun and with Qt 6 a version 6 of the KDE Frameworks is due. This will gives us the opportunity to clean up and redesign some of our API.

Main goal for the sprint was to discuss the major design principles for KF6. I personally focussed on two aspects. First, we want to better separate logic from the user interface to allow different UI implementations for desktop and mobile uses. Futhermore, we want to reduce the amount of dependencies our libraries have. While we are doing fine for a lot of frameworks some have very ugly dependency structures. Probably our worst offender here is KIO, the framework that powers Dolphin and many more KDE applications.

KDE Connect and Android

As most of you know KDE Connect has recently been removed from Google Play due to a policy violation with regard to our SMS and telephony features. While the public outcry helped to get it back in with all features remaining this is just yet another example of how new Android policies make it harder for us to maintain the level of quality and features you expect from KDE Connect. Android Oreo forced us to drop support for older Android versions and imposed restrictions on background services which force us to have an annoying persistent notification. It is to be expected that Google will further restrict background services which will impose more problems for us. With each new Android versions new restrictions and problems arise which we have to work around, if possible. For example, the upcoming Android Q imposes restrictions on accessing the phone’s clipboard. It is unclear whether the clipboard sync in it’s current form is feasible on Android Q. Those are just examples of the problems with the direction Android is moving towards.

© Nicolas Fella, 2025 MastodonNicolas Fella
Powered by Hugo, theme Anubis.