summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Reilly Brogan2023-12-29 17:19:48 -0600
committerGravatar Reilly Brogan2023-12-29 20:32:08 -0600
commitcb4b4f3d6e531a67df9641f791ade284ffd507cb (patch)
treea0b5c73d0aad65f1bcd87af54b78b184c54ec83c
parentMerge pull request #12455 from liamwhite/end-wait (diff)
downloadyuzu-cb4b4f3d6e531a67df9641f791ade284ffd507cb.tar.gz
yuzu-cb4b4f3d6e531a67df9641f791ade284ffd507cb.tar.xz
yuzu-cb4b4f3d6e531a67df9641f791ade284ffd507cb.zip
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.
-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 059fcf041..c789c1e59 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -5342,6 +5342,10 @@ int main(int argc, char* argv[]) {
5342 if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) { 5342 if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) {
5343 qputenv("DISPLAY", ":0"); 5343 qputenv("DISPLAY", ":0");
5344 } 5344 }
5345
5346 // Fix the Wayland appId. This needs to match the name of the .desktop file without the .desktop
5347 // suffix.
5348 QGuiApplication::setDesktopFileName(QStringLiteral("org.yuzu_emu.yuzu"));
5345#endif 5349#endif
5346 5350
5347 SetHighDPIAttributes(); 5351 SetHighDPIAttributes();