-
Notifications
You must be signed in to change notification settings - Fork 258
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
Linux: Force SDL2 video driver selection to X11 #197
Linux: Force SDL2 video driver selection to X11 #197
Conversation
Related issue: rt64/rt64#19 |
boom shroom does this PR work for you as well? |
I don't currently have this exact patch, but I do have the same line in my local repo, just without the Since I'm running Wayland normally, I automatically set |
Forcing an unsupported backend will end up in a crash. I'm not sure what you are expecting. You should not try to force apps to use Wayland via This PR tells SDL2 to always prefer x11 (i.e. even if fifo-v1 and commit-timing-v1 are present). But you should absolutely not try to force it via environment variables. That env. variable should only be used to workaround specific problems with specific apps. |
What I was expecting was setting a preferred backend, and then a fallback in case the first is unsupported. (Alternatively, a crash saying "video driver not supported" rather than a segfault.) I was unaware that the environment variable, even when set with multiple backends, would always force the first. Until now, I hadn't noticed any issues with running SDL applications with the variable set. |
Would it be best if I adddd a check further down verifying that what SDL gave us is indeed an X11 window and exiting if it's not? That way it can catch a case like this of a user trying to override the preference instead of crashing. |
@nadiaholmquist would you mind doing an empty push to validate with the CI? Our move to an organization means secrets won't take until the next push (even if retrigger) |
Sorry, I'm not at my computer currently so I can't do that. I think any collaborator in the organization should be able to do it though. |
Didn’t want to invade the PR. If that’s ok with you, I’ll do that then |
Yeah that's alright. |
Looks like GitHub has failed us here. I’m gonna close and reopen and see if that takes. |
Turns out it’s an issue with forks and secrets, we’re working on a fix |
@nadiaholmquist I believe this is now fixed. Rebasing the branch against |
51195c3
to
b8df537
Compare
bleh I didn't have all changes locally apparently and only noticed after force pushing. Let me just fix that real quick. Edit: There we go. |
Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
b8df537
to
8f04ad0
Compare
Thanks a lot for the fix @nadiaholmquist and for bearing with us as we sorted out the workflow issue! |
It looks like RT64 does not currently support Wayland and unconditionally expects to receive an X11 window, but on some distros (namely, Fedora in my case) SDL2 will select the Wayland video driver by default.
While it'd of course be preferable to support both, this PR adds a small change to forcibly set the SDL2 video driver to X11 if the Wayland driver is present to prevent the game from crashing for people.