Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce XCB within code #13286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Data/dolphin-emu.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Version=1.0
Icon=dolphin-emu
Exec=env QT_QPA_PLATFORM=xcb dolphin-emu
Exec=dolphin-emu
Terminal=false
Type=Application
Categories=Game;Emulator;
Expand Down
4 changes: 0 additions & 4 deletions Flatpak/org.DolphinEmu.dolphin-emu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ rename-icon: dolphin-emu
finish-args:
- --device=all
- --socket=pulseaudio
# dolphin doesn't work on wayland (only the ui does), if a user were to set
# this env variable globally to wayland then games wouldn't work.
# we overwrite the setting and force xcb to prevent this from happening.
- --env=QT_QPA_PLATFORM=xcb
- --socket=x11
- --share=network
- --share=ipc
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/DolphinQt/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ int main(int argc, char* argv[])
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
setenv("QT_XCB_NO_XI2", "1", true);
#endif
// Dolphin currently doesn't work on Wayland (Only the UI does, games do not launch.) This makes
// XCB the default and forces it on if the platform is specified to be wayland, to prevent this
// from happening.
// For more information: https://bugs.dolphin-emu.org/issues/11807
const char* current_qt_platform = getenv("QT_QPA_PLATFORM");
const bool replace_qt_platform =
(current_qt_platform && strcasecmp(current_qt_platform, "wayland") == 0);
setenv("QT_QPA_PLATFORM", "xcb", replace_qt_platform);
#endif

QCoreApplication::setOrganizationName(QStringLiteral("Dolphin Emulator"));
Expand Down