aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorReilly Brogan <reilly@reillybrogan.com>2023-12-29 17:19:48 -0600
committerReilly Brogan <reilly@reillybrogan.com>2023-12-29 20:32:08 -0600
commit73d189050ce8445d11df05d89c75d551d5f3191b (patch)
treea0b5c73d0aad65f1bcd87af54b78b184c54ec83c /src/yuzu/main.cpp
parentacc826f8fa49b543a86a64bc953cf3c194a4f839 (diff)
Fix Wayland appId
On compliant Wayland compositors windows are matched to their .desktop files by comparing the appId window property to the name of the .desktop file without the .deskop extension. Qt5/6 by default set this property to the basename of the binary (IE `yuzu`) which does not match the expected value `org.yuzu_emu.yuzu`. We can fix this and fix window associations on compliant compositors (like Plasma) by using the `setDesktopFileName()` function which will set the appId window property. This is a no-op on X11 so is safe to be ran without guards.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 059fcf0413..c789c1e59e 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -5342,6 +5342,10 @@ int main(int argc, char* argv[]) {
if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) {
qputenv("DISPLAY", ":0");
}
+
+ // Fix the Wayland appId. This needs to match the name of the .desktop file without the .desktop
+ // suffix.
+ QGuiApplication::setDesktopFileName(QStringLiteral("org.yuzu_emu.yuzu"));
#endif
SetHighDPIAttributes();