qtui: Set desktop file name
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Fri, 22 Mar 2019 21:37:22 +0000 (22:37 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 4 Aug 2019 19:21:23 +0000 (21:21 +0200)
The XCB platform plugin defaults the WM class to the executable name,
which already matches our desktop file name. Unfortunately, the Wayland
platform plugin prepends the inverted organization domain, resulting in
an app ID of "org.quassel-irc.quasselclient", thus breaking the
association.

Set the desktop file name explicitly so the Wayland platform doesn't get
confused.

src/main/monoapplication.cpp
src/qtui/qtuiapplication.cpp

index daee316..aa54ddf 100644 (file)
@@ -30,7 +30,11 @@ class InternalPeer;
 
 MonolithicApplication::MonolithicApplication(int& argc, char** argv)
     : QtUiApplication(argc, argv)
-{}
+{
+#if QT_VERSION >= 0x050700
+    QGuiApplication::setDesktopFileName(Quassel::buildInfo().applicationName);
+#endif
+}
 
 void MonolithicApplication::init()
 {
index 4685d51..b7e8e8c 100644 (file)
@@ -36,6 +36,9 @@ QtUiApplication::QtUiApplication(int& argc, char** argv)
 #if QT_VERSION >= 0x050600
     QGuiApplication::setFallbackSessionManagementEnabled(false);
 #endif
+#if QT_VERSION >= 0x050700
+    QGuiApplication::setDesktopFileName(Quassel::buildInfo().clientApplicationName);
+#endif
 }
 
 void QtUiApplication::init()