cage icon indicating copy to clipboard operation
cage copied to clipboard

Sync clipboard with host compositor

Open ddevault opened this issue 5 years ago • 9 comments

Same story as #62. Should be pretty easy but may require wlroots changes.

ddevault avatar Apr 25 '19 03:04 ddevault

I'd be interested to work on this feature. I use wio for compositing, and this « clipboard sync » is needed for the clipboard to be shared between all cage instances.

If I understand the issue correctly, this would require the compositor to act as a client to the wl_data_control interface of the underlying compositor. Is that correct ?

If so, could you point me in the right direction to get started with it ? Is there already a portion of the code that's used to relay requests to a wayland server ? Also, what is the interface to use for clipboard/selection management ?

z3bra avatar Nov 05 '20 19:11 z3bra

Are wlroots changes still needed?

Related Plagman/gamescope/issues/303

tinywrkb avatar Feb 04 '22 19:02 tinywrkb

wlroots changes should not be necessary.

emersion avatar Jul 28 '23 15:07 emersion

If someone want to work on this, I have a partial (only selection, aka clipboard, no primary selection or DnD), quick & dirty implementation here : https://github.com/sloonz/cage

But unless I missed something, contra emersion it will need some changes to wlroots, at minimum a public function wlr_wl_backend_get_display to be able to access the remote display. A way to access the registry without having to bind to it a second time would be nice too.

sloonz avatar Sep 03 '23 08:09 sloonz

But unless I missed something, contra emersion it will need some changes to wlroots, at minimum a public function wlr_wl_backend_get_display to be able to access the remote display.

FYI, there is a wlr_wl_backend_get_remote_display() API in wlr/backend/wayland.h. [1]

[1] https://wayland.emersion.fr/wlroots/wlr/backend/wayland.h.html#func-wlr_wl_backend_get_remote_display

GalaxySnail avatar Sep 03 '23 09:09 GalaxySnail

I don’t know how I missed that. Will update my fork shortly.

sloonz avatar Sep 03 '23 09:09 sloonz

Updated commit : https://github.com/sloonz/cage/commit/619e8f1a871c3eea76faf4d566eebd2b478bd83e

sloonz avatar Sep 03 '23 10:09 sloonz

data-control does not sound like a protocol we should be using for this. The core Wayland protocol should be enough.

Do you plan to open a pull request?

emersion avatar Sep 07 '23 01:09 emersion

data-control does not sound like a protocol we should be using for this. The core Wayland protocol should be enough.

Yeah, that’s what I realized once I was 99% done. It’s the kind of change that must be made before being made into a proper pull request.

Do you plan to open a pull request?

Not right now, I don’t really have the time. But I probably eventually will if nobody does.

sloonz avatar Sep 07 '23 12:09 sloonz