-
Notifications
You must be signed in to change notification settings - Fork 341
[WIP] wlr_primary_selection: Allow multiple offers per source #1113
Conversation
Create as many offers as there are selection devices, so that we do not send a client multiple times the same "new_id" offer (which would make it crash) Part of #1041
BTW if there is no client in wleird that binds to the seat twice and deals with data devices I think it would be a nifty thing to add (I guess saying that means I'm welcome to do it... But it can't hurt to try, I already have a weird client called firefox here :P) |
Maybe |
Hm, that'll certainly be less code change for wlr_data_device. |
Right, I was thinking that using |
We could set the offer's resource user data to the device, and use the offer's resource link to store only that list of resource in the wlr_x_offer struct. That would spare making that extra wrapper item, I'll try that. |
Ah, we already use that user data to store a pointer to the wlr offer struct in the wl_resource offer, so I can't use it for the device :/ Tricky. |
Just a note here as I had totally forgotten about this until emersion mentioned it on IRC yesterday when someone asked about firefox-wayland. Part of the reason I forgot is that I'm a bit stale on ideas for what to do, this implementation pattern works for firefox but will be quite a bit of churn in wlr_data_device if I take the same approach. I'll be afk the next couple of days regardless, but if there is some form of agreement on the direction to take I'll look at it when I'm back :) |
When a client was creating multiple data devices for the same seat, we were only creating one resource. This is a protocol error. Instead, create one offer per data device. This commit also makes offers inert when their source is destroyed. Fixes part of swaywm#1041 Supersedes swaywm#1113
When a client was creating multiple data devices for the same seat, we were only creating one resource. This is a protocol error. Instead, create one offer per data device. This commit also makes offers inert when their source is destroyed. Fixes part of swaywm#1041 Supersedes swaywm#1113
Superseded by #1380; thanks! |
Create as many offers as there are selection devices, so that we do
not send a client multiple times the same "new_id" offer (which
would make it crash)
Note something is weird with this and X11; once I've selected something in firefox then pastes to X11 do not work anymore (even from other wayland apps); I don't understand what though so could use some help with that.
Part of #1041 (this is not complete as it only does primary_selection, data_source needs a similar fix... but data source uses source->offer everywhere (like in drag n drop as well) so such an approach is going to be a royal pain)
Cc @aereaux as he said he would work on this a couple of weeks ago, if you want to take over please do (I can find something else to do :P); or if you just have thought about it and have an opinion it's welcome as well :)