Cloudef / wlc

High-level Wayland compositor library
MIT License
331 stars 58 forks source link

Make SDL work on wlc (wl_registry@2: error 0: invalid version for global wl_data_device_manager (4): have 2, wanted 3) #281

Open L-as opened 6 years ago

L-as commented 6 years ago

I don't exactly know how these versions work and all that (not much info on the web), but it seems to be related to wlc/src/compositor/seat/data.c line 174 and line 235.

If someone could give some hints as to how I could implement it myself, I'd be glad too.

This is BTW on with wlc 0.0.10, sway 0.14, and it happens when running an SDL program (Natural Selection 2) using the wayland videodriver.

Will be hard to reproduce for others, but here are the steps: Change to beta branch on steam Go into x64 subfolder Fix incorrect symlinks to fmod libs run program as SDL_VIDEODRIVER=wayland ./ns2_linux

ddevault commented 6 years ago

The data device manager API is specified in wayland-server-protocol.h, and specifies which features appeared in which version. You should take a look at that to find out what we need to shore up. Note that wlc doesn't support drag and drop, so you may be limited in what you can accomplish beyond placating clients unless you intend to implement DnD.

L-as commented 6 years ago

thanks

L-as commented 6 years ago

So I took a look into this, and wl_data_device_manager_interface doesn't seem to have any methods that say @since 3. Am I missing something here? Or do I have to implement all @since 3 methods? (which there are 8 of)

ddevault commented 6 years ago

Check the implementations of the child objects - wl_data_offer, wl_data_source, and wl_data_device. These all inherit the whole interface's version number iiuc.

L-as commented 6 years ago

So I tried to implement this, since I had time, but I'm having problems. I get this error: wl_display@1: error 2: no memory This is after implementing set_actions and finish for data_offer and data_source.

Commits are available at https://github.com/Laaas/wlc, do you see anything wrong with them?

L-as commented 6 years ago

Also yes, I do realise that the set_actions ones aren't really doing anything useful, but I have no idea where to actually use the acquired values.

ddevault commented 6 years ago

It isn't immediately apparent to me. Have you tried stepping through it with a debugger?

L-as commented 6 years ago

I didn't find much using a debugger, because it isn't a fatal error. I did test it on weston though, and it worked fine there. Going to take a look at their implementation.

L-as commented 6 years ago

Oh wow, I'm stupid. I forgot to enable debugging and verbose logging.

L-as commented 6 years ago

Well, I've tested it a bit and SDL seems to start up. Don't know if it completely works though, have to test it some more.