Skip to content

Commit

Permalink
Set the app's desktop file name
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelweghorn authored and misery committed Mar 25, 2024
1 parent bc1ee3c commit 383ef9a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/qml/UIPlugInQml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down

0 comments on commit 383ef9a

Please sign in to comment.