cage-kiosk / cage

A Wayland kiosk
https://www.hjdskes.nl/projects/cage
MIT License
1.05k stars 72 forks source link

Sync clipboard with host compositor #63

Open ddevault opened 5 years ago

ddevault commented 5 years ago

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

z3bra commented 3 years ago

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 ?

tinywrkb commented 2 years ago

Are wlroots changes still needed?

Related Plagman/gamescope/issues/303

emersion commented 11 months ago

wlroots changes should not be necessary.

sloonz commented 10 months ago

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.

GalaxySnail commented 10 months ago

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

sloonz commented 10 months ago

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

sloonz commented 10 months ago

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

emersion commented 10 months ago

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?

sloonz commented 10 months ago

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.