From 383ef9a802a2a4e82376ca51dfc5a801c1284ba8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Sun, 24 Mar 2024 21:16:49 +0100 Subject: [PATCH] Set the app's desktop file name Set the desktop file name for the application using QGuiApplication::setDesktopFileName [1]. This is used by window managers/Wayland compositors like KWin to display the proper window icon on Wayland rather than a generic Wayland icon. On Linux, the desktop file is searched in $XDG_DATA_DIRS (see the desktop file spec, [2]), so the desktop file installed to `/usr/share/applications/com.governikus.ausweisapp2.desktop` is found this way. [1] https://doc.qt.io/qt-6/qguiapplication.html#desktopFileName-prop [2] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html --- src/ui/qml/UIPlugInQml.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/qml/UIPlugInQml.cpp b/src/ui/qml/UIPlugInQml.cpp index caaf3465..d114ca63 100644 --- a/src/ui/qml/UIPlugInQml.cpp +++ b/src/ui/qml/UIPlugInQml.cpp @@ -192,6 +192,7 @@ UIPlugInQml::UIPlugInQml() #ifndef Q_OS_ANDROID QGuiApplication::setWindowIcon(mTrayIcon.getIcon()); #endif + QGuiApplication::setDesktopFileName(QStringLiteral("com.governikus.ausweisapp2")); connect(&mTrayIcon, &TrayIcon::fireShow, this, &UIPlugInQml::show); connect(&mTrayIcon, &TrayIcon::fireQuit, this, [this] {