Ubuntu 26.04 Fixes – 2 – Frameless and Flat Qt Windows

One of the small quirks I noticed after installing Ubuntu 26.04 was that some apps like Wireshark, LuckyBackup and KeePassXC look strange. The reason: There is no window decoration so they appear flat, which looks especially strange against a white background. What they all have in common: They are Qt based applications. And it seems there is a dispute between Wayland, to which I had to switch from X-Windows on the one hand, and Qt on the other. Wayland insists that apps themselves should be responsible for drawing their window frames. Qt on the other hand thinks this should be done by the the compositor. So in Ubuntu 26.04, neither side draws the window frames for Qt apps, which makes them look flat and ugly on the system. But there is a fix 🙂

Shell Launch

The fix is to run Qt apps on the ‘X-window to Wayland compatibility protocol’ instead of Wayland directly. And this shim in between still draws the window borders. It’s a kludge, but it works. On the shell, Qt apps can be started as follows to make them look OK again in Ubuntu 26.04:

$ QT_QPA_PLATFORM=xcb luckybackup
$ QT_QPA_PLATFORM=xcb wireshark

Desktop / Dock/ Launcher Modification

The same effect can be achieved for launching a Qt app from the Gnome/Ubuntu Dock by modifying the ‘Exec=’ line of the dash launcher config file for the app. Here’s how this is done by copying the launcher file to the user’s directory and modifying it there.

cd ~/.local/share/applications
cp /usr/share/applications/org.wireshark.Wireshark.desktop .

# now edit the local desktop file and modify the Exec= 
# line as follows:
#
# original: Exec=wireshark %f
#
# modified: Exec=env QT_QPA_PLATFORM=xcb wireshark %f

Note that there is a deceivingly similar Exec line above the real exec line in some of those files, so make sure you edit the right one! No restart required, the change is effective right after the changes are saved.

Flatpack Version

For Flatpak based GUI applications, the approach is a bit different: As the app is isolated from the system, Flatpak instead of the app has to be configured to set the Qt environment variable when the app is started. The following example shows how this is done for KeePassXC:

$ flatpak override --user --env=QT_QPA_PLATFORM=xcb org.keepassxc.KeePassXC

And to set it back to the original setting:

$ flatpak override --user --reset org.keepassxc.KeePassXC

All not really nice, and as a user I shouldn’t really be bothered by this dispute, but at least here’s the work around.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.