Skip to content

Commit daa228e

Browse files
committed
Make the wayland appId the same as WM_CLASS
1 parent dafa013 commit daa228e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

owncloud.desktop.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Keywords=@APPLICATION_NAME@;syncing;file;sharing;
1010
X-GNOME-Autostart-Delay=3
1111
MimeType=application/vnd.@APPLICATION_EXECUTABLE@;
1212
Actions=Settings;Quit;
13-
StartupWMClass=@APPLICATION_NAME@
13+
StartupWMClass=@APPLICATION_EXECUTABLE@
1414

1515
# Translations
1616
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client

src/gui/main.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@ int main(int argc, char **argv)
443443
app.setWindowIcon(Theme::instance()->applicationIcon());
444444
app.setApplicationVersion(Theme::instance()->versionSwitchOutput());
445445

446+
#ifdef Q_OS_LINUX
447+
// HACK:
448+
// With X11 arg0.name is used to map WM_CLASS to the desktop file.
449+
// With Wayland it uses app.desktopFileName() or app.organizationDomain()
450+
// As we preferably use AppImages the real deskop file name is unknown, we just ensure it mathces the StartupWMClass entry in our desktop file
451+
if (qgetenv("XDG_SESSION_TYPE") == "wayland") {
452+
// https://bugreports.qt.io/browse/QTBUG-77182 Qt 6.9 brings setAppId() but its private api
453+
app.setDesktopFileName(QFileInfo(app.applicationFilePath()).baseName());
454+
}
455+
#endif
456+
446457
// Load the translations before option parsing, so we can localize help text and error messages.
447458
const QString displayLanguage = setupTranslations(&app);
448459

0 commit comments

Comments
 (0)