Add Standalone Wayland Support#14652
Conversation
Many graphics APIs don't have a way to get the backend scale, and wayland doesn't have a way to get the surface size either
Qt seems to do this, and if you don't, MVK doesn't realize it needs to resize things
|
This has all the hallmarks of, at least, an AI-written summary. Was this vibe coded? |
|
the code was not vibe coded. and yes I did modify summary with ai to make it cleaner and more concise. |
|
Would you mind at least linking to where the code originally came from? |
The code originally came from https://github.com/TellowKrinkle/dolphin/tree/Wayland |
TellowKrinkle
left a comment
There was a problem hiding this comment.
For reference, when I developed this branch, it didn't properly detect hidpi displays and assumed dpr was 1 due to an issue where Qt would initially report that for the window and didn't send any events we recognize when it did eventually change to 2. That may be fixed by now, or maybe it's considered good enough to merge even with that bug, but someone should at least test and see if it still happens.
Also, please rebase instead of merging (and fix issues on the commits where they happen, so each commit in the chain builds and works).
| else if (platform_name == QStringLiteral("xcb")) | ||
| return WindowSystemType::X11; | ||
| else if (platform_name == QStringLiteral("wayland")) | ||
| else if (platform_name.startsWith(QStringLiteral("wayland"))) |
|
Also
It can in fact create an accelerated GL context using XWayland |
| endif() | ||
|
|
||
| if(ENABLE_WAYLAND) | ||
| find_package(Wayland REQUIRED) |
There was a problem hiding this comment.
The REQUIRED keyword here for ENABLE_WAYLAND doesn't match the behavior of ENABLE_X11, which just gives a warning if X11 cannot be found. Could you please make the behavior consistent between the two?
|
You probably want to add the needed libraries to the Linux CI as well. |
What problem does this Pull Request solve?
Some graphics stacks (including mine) only provide Wayland for display. Since Dolphin currently relies on Xwayland, these systems end up without hardware acceleration, and in some cases certain drivers won’t even start. This PR adds native Wayland support to address that issue.
Why this change is needed
Without Wayland support, Dolphin cannot create an accelerated GL context on Wayland‑only systems. This results in poor performance or complete failure to launch games. Adding a Wayland backend allows Dolphin to run properly on modern Linux setups that no longer ship X11.
What this Pull Request does
I found an old fork that implemented Wayland support, but it was very outdated. I updated it, fixed the merge conflicts, and brought it up to date so it can be considered for inclusion in mainline Dolphin.
Notes for reviewers
Please double‑check the changes. I want to make sure nothing breaks in the existing graphics paths. My goal is to contribute this feature safely without affecting other platforms or backends.