wlc icon indicating copy to clipboard operation
wlc copied to clipboard

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

Open L-as opened this issue 8 years ago • 10 comments

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

L-as avatar Oct 02 '17 16:10 L-as

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.

ddevault avatar Oct 02 '17 16:10 ddevault

thanks

L-as avatar Oct 02 '17 16:10 L-as

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)

L-as avatar Oct 02 '17 19:10 L-as

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.

ddevault avatar Oct 02 '17 19:10 ddevault

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 avatar Oct 13 '17 22:10 L-as

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.

L-as avatar Oct 13 '17 22:10 L-as

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

ddevault avatar Oct 13 '17 23:10 ddevault

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 avatar Oct 14 '17 08:10 L-as

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

L-as avatar Oct 14 '17 08:10 L-as

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.

L-as avatar Oct 14 '17 10:10 L-as