Add some stubs for newer protocol bits in the data manager, claiming support for protocol version 3.#53
Conversation
and claim support for protocol version 3. This is enough to allow some SDL2 applications to work.
michaelforney
left a comment
There was a problem hiding this comment.
Thanks for the PR! I'm curious why SDL2 requires these features in wl_data_device. Do you have any links to the relevant code?
I'll need to do a bit of reading of the spec before merging this. Sorry about the wait.
libswc/data_device.c
Outdated
| static const struct wl_data_device_interface data_device_impl = { | ||
| .start_drag = start_drag, | ||
| .set_selection = set_selection, | ||
| .release = release |
There was a problem hiding this comment.
I think this should be .release = destroy_resource, which will call wl_resource_destroy, which calls the destructor (data_device_destroy), and then destroys the wl_resource.
I think it's just requesting version 3 for no good reason. It's also just defining stubs for these capabilities in https://github.com/spurious/SDL-mirror/blob/master/src/video/wayland/SDL_waylandevents.c#L681
https://github.com/spurious/SDL-mirror/blob/master/src/video/wayland/SDL_waylandvideo.c#L384 I should correct my first post that this actually allows (all?) SDL2 applications to work, except those also using GLEW. I previously had a bug that was preventing non-GL applications from running, but that seems resolved. So you can run milkytracker, Dungeon Crawl, mpv, etc. |
|
Thanks for the links. SDL should definitely not be trying to bind version 3 of wl_data_device_manager if the compositor advertises a lower version. That will always result in a protocol error. I submitted a patch to fix that at https://bugzilla.libsdl.org/show_bug.cgi?id=4924. It looks like SDL does use the v3 request On the swc side, I went ahead and pushed support for v2 first, since that was an easy change. For v3, apart from the two stubs you added, I think we also need add |
This is enough to allow some SDL2 applications to work, e.g. quakespasm. It was done in my fork of swc that adds support for NetBSD and a new "seat" for the wscons input API, in case you're interested in that.