Ugly window decorations for Wayland-native QT applications on Gnome Wayland

Hi everyone,
so I want to run my Qt applications with native Wayland support to benefit from perfect scaling on my HiDPI screen and so on.
Therefore I export the following variables (not all related to scaling, just to let you know):

QT_QPA_PLATFORMTHEME=qt5ct
QT_IM_MODULE=ibus
QT_AUTO_SCREEN_SCALE_FACTOR=1
QT_QPA_PLATFORM=wayland

Scaling works fine now, but I noticed that I get some ugly window decorations then:


It doesn’t matter if I activate the Kvantum themes or leave it on the default ones (actually, I don’t see a default theme on the Qt6 configuration tool).
The window decorations look exactly the same for Qt5 based apps.

Is it somehow possible to get window decorations that use GTK or at least look like they do and thus fit better into the overall Gnome environment?

kvantum doesn’t set window decorations; it only concerns itself with the application appearance. Furthermore, Wayland uses client-side decorations, which means that the window decorations depend on the application itself and are not managed by the window manager.

Try setting your qt applications to use the Adwaita style, which is what GNOME uses.

wayland does not equal Qt - wayland is a display server protocol - it has nothing in common with the toolkit in use.

Wayland has been designed to replace X11.

  • Qt is a toolkit
  • GTK is the acronym of Gnome Tool Kit

If the application has not been built with hidpi in mind then nothing you do can change that.

Mixing GTK and Qt apps will always create theming inconsistencies - I don’t think that is ever going to change - simply something we have to live with.

Thanks for the clarification, but I was already aware of the differences between an application toolkit like Qt/GTK and a display server protocol like Wayland.
And the thing about most Qt applications like Okular, Jellyfin, or Anki is that they are very will HiDPI capable, as long as they use a somewhat recent Qt version and are compiled with Wayland support (not 100% sure how it exactly works, but if Qt5/6-Wayland is installed and QT_QPA_PLATFORM=wayland is set, it just works).
Anyway, HiDPI support is not really the problem here.

I just wanted to know if I can somehow achieve GTK-like window decorations with Wayland-native Qt applications.

And yes, I am aware of this as well (even tho KDE supports SSDs).

The question that I ask myself if Gnome doesn’t draw the window decorations, then it must be … Qt itself?
Is this just the not so pretty fallback of Qt if SSDs are not supported? And if yes how can I style it?
Or is something from outside influencing it?

I tried the Adwaita style, but while it changed the application appearance, it didn’t change the Window decorations, unfortunately:

For Qt6(ct) I don’t even have an Adwaita option in the dropdown menu:

There are two Adwaita packages for qt6 in the AUR: kvantum-theme-libadwaita-git (which needs to be loaded into the kvantum manager) and adwaita-solarized-qt6 (of which there is also a qt5 version).

You can install them using… :point_down:

pamac build <name-of-package(s)>

Mind you, I don’t use GNOME and I personally have a strong dislike for Adwaita, so I have no idea what these two themes will look like. You may also need to log out and back in after installing them for the theme to take effect.

The HiDPI will only work if the application itself defines it.

This following snippet is from 4 years ago when I struggled with a python GUI application which didn’t scale correct. I had to make an explicit call very early in application init to make it HiDPI aware.

"""
Set application attributes before creating object
Enable High Dpi Scaling
"""
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)

This has nothing to do with the display manager whether this is X11 or Wayland - so I still think your compiled with Wayland support description is a bit off track.

This is the point I was trying to make in may earlier comment.

Whether or not you get decent window decoration is a different topic - the theming issue I mentioned - kvantum was/is an attempt to circumvent these limitations - successful or not :slight_smile:

kvantum does not handle window decorations. It only handles the appearance of the application itself — i.e. the toolbars, progress bars, scroll bars, buttons, item lists, et al.

Window decorations are managed by the window manager, or — in the event of client-side decorations — by the application, in which case the application will use the default window decoration for the chosen theme.

Wayland defaults to client-side decorations, unlike in X11, where the window decorations are (normally) handled by the window manager.

Client-side decorations usually means that the window won’t have a title bar with window operations buttons for closing, minimizing and maximizing. In an environment with client-side decorations, those buttons are displayed in the toolbar of the application instead.

The downside of this is that if the application crashes, then you cannot close its window anymore via the “window close” button, because this button and all clicks on it are supposed to be handled by the application that has just crashed. With server-side window decorations on the other hand, the control of these buttons still lies with the window manager, and thus the window manager can still destroy the window of a crashed application.

Okay thanks, I guess I was mixing up Wayland support and HiDPI support for Qt-based applications.
I thought this always goes hand in hand.

Okay, makes sense in general but what does this mean for my concrete case? :sweat_smile:
If the window manager doesn’t draw the window decorations, what else does it (because they are some, as you can easily see)?
My guess is that they come from the Qt framework or some attached project.

And in the end: Is there any possibility to style the (client-side) window decorations for Qt-based Wayland applications (wherever they might come from) so that they fit a bit better into a Gnome environment?

About kvantum: If Qt apps are forced to draw CSDs in Gnome/ Wayland, wouldn’t the decorations also be part of “application itself”?
I have the strong feeling, that those (fallback) decorations come from somewhere else, because they are completely unaffected by any theming.

Why, yes. The KDE Frameworks do allow for individual components of the built-in Breeze theme to be stylized differently.

I suppose so, but this would have to be done through the qt5ct/qt6ct modules.

The application, yes, but not the application themekvantum only handles the application theme. But the window decorations in your screenshot are not from the built-in Breeze theme — they’re from one of the many macOS-style Aurorae decorations at store.kde.org — which means that you must have installed them yourself in some way.

In Plasma proper, there is a button for getting new “things” — depending on the page in System Settings that you’re looking at — from store.kde.org. Window decorations downloaded this way are stored in ~/.local/share/aurorae. Maybe you can look around in there?

Unfortunately, I don’t have a folder ~/.local/share/aurorae.
I’m pretty sure that those decorations are the default Qt decorations when under Gnome Wayland, but I will quickly set up a Manjaro VM to test if that’s true.

Edit:
So yeah, apparently that’s the default decorations style when you use QT Wayland-native applications under Gnome.
Here is a screenshot from a fresh Manjaro Gnome instance, where I just installed qt5-wayland to run Qt apps via Wayland (And Gnome Layout Switcher, thus installed Kvantum as well).


As you can see, the decorations look the same as on my normal instance.

And if I’m even uninstalling Kvantum and Kvantum-Manjaro completely, it uses the ugly Windows style per default :smile: :woozy_face:
But the window decoration stay the same, so they have definitely nothing to do with Kvantum (as @Aragorn already stated).

So I guess there is no option to change the window decorations for Qt Wayland-enabled apps, right?