-
Notifications
You must be signed in to change notification settings - Fork 20
Add wayland support with SDL_VIDEODRIVER=wayland
#17
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
base: master
Are you sure you want to change the base?
Conversation
|
Could you provide some more info on the crash you encountered: Linux distro, version, window manager, etc. Was XWayland not installed? I haven't looked into Wayland support because I assumed that there are enough other X applications that X support would remain for the foreseeable future ... but maybe I am mistaken? Is all text missing from the UI? This can happen if Roboto-Regular.ttf is not in the same folder as the executable (although there should be dialog that appears in this case). |
|
Regarding the crash, it only happens when wayland backend is explicitly used via back to the crash, it was due to Red-hat marked xorg as deprecated some time ago, but I don't think xwayland is going away anytime soon, so you're not wrong in thinking X apps would continue to work.
I didn't see any dialog, but I'll double-check tomorrow, thanks |
SDL_VIDEODRIVER=wayland
|
Sure, native Wayland support would be welcome. I don't think there is X-specific code in any other files. Happy to answer any other questions that come up. |
this was indeed the fix right now SDL seems to handle touch events fine (with some caveat below). Should I rely on SDL's builtin touch support or read raw touch events from wayland and re-emit SDL ones (like in the xorg tablet handler)? I'm not really sure if the touch support exists in the current SDL submodule, but since on linux it's recommended to USE_SYSTEM_SDL perhaps that's not a problem...? There is currently a "bug" where: SDL3 has builtin support for tablets it seems. Not saying you should migrate, but just want to know if there are plans to do so - if there are, it might make more sense for me to wait for a SDL3 migration to take advantage of the builtin tablet support |
|
I would recommend bypassing SDL for all mouse, touch, and pen input as is done for X in the current linuxtablet.c Using pixel positions instead of normalized values for I don't plan to migrate to SDL3. I haven't looked carefully at how it implements tablet support for other platforms, but on Windows it doesn't appear to support high resolution position data ( I intend to replace SDL with the platform support from styluslabs/maps. For Linux that's linuxmain.cpp, most of which is just cut-and-paste from Write's linuxtablet.c, so creating a wayland version of linuxtablet.c now wouldn't be any wasted work. |
872042f to
cb82eb4
Compare
Adds support for using the wayland SDL backend. Needs to be "enabled" by the user by running with the environment variable
SDL_VIDEODRIVER=waylandSo far nothing "meaningful" is done - I just made it not crash under wayland, tablet and
clipboard (and probably more) support is presumably broken for now.
TODO:
If there are other code that depends on X11 that you know of, I would appreciate a mention :)
Note that I'm not going to make wayland the default because upstream SDL doesn't and I'm not smart
enough to understand why.