Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland support #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trimental
Copy link

@trimental trimental commented Mar 15, 2019

There are a few specifics to do with wayland design that sets this implementation apart from others such as x11

  1. A wayland window must be created by the client and have focus before setting or getting the clipboard contents
  2. Wayland events must be continuously dispatched for the clipboard to work. smithay-clipboard's new_threaded() method takes care of this using a thread that continuously dispatches those events
  3. You need to specify the name of the seat you want to use to access the clipboard from (each seat has a different clipboard). By default I've set it to seat0 as multiple seats are an exotic thing in the wayland ecosystem however it can be changed with the set_seat() function.
  4. A wayland display must be passed to the creation of the clipboard and that must be the same display what the window is using

I've left the default ClipboardContext set to X11ClipboardContext on linux and I think that allowing the user to directly use WaylandClipboardContext at their discretion to fit their needs would be a good enough API.

I've also added a wayland example to test out the implementation.

@trimental trimental force-pushed the wayland-support branch 7 times, most recently from 4a0cd00 to f410c54 Compare March 15, 2019 08:56
@chrisduerr
Copy link

I think this implementation is a bit troublesome since it does not use the ClipboardProvider trait, so that would make it pretty difficult for the consumers to abstract over different platforms.

I've got an alternative implementation here:
https://github.com/chrisduerr/rust-clipboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants