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

Clipboard handling? #162

Closed
ozkriff opened this issue Apr 19, 2017 · 9 comments
Closed

Clipboard handling? #162

ozkriff opened this issue Apr 19, 2017 · 9 comments
Labels
D - hard Likely harder than most tasks here H - help wanted Someone please save us P - normal Great to have S - api Design and usability S - enhancement Wouldn't this be the coolest?

Comments

@ozkriff
Copy link
Contributor

ozkriff commented Apr 19, 2017

No description provided.

@tomaka tomaka added the S - api Design and usability label Apr 19, 2017
@ozkriff
Copy link
Contributor Author

ozkriff commented Apr 22, 2017

https://docs.rs/clipboard may help

@francesca64 francesca64 added S - enhancement Wouldn't this be the coolest? H - help wanted Someone please save us D - hard Likely harder than most tasks here P - normal Great to have labels May 6, 2018
@torkleyy
Copy link
Contributor

I think the clipboard crate works just fine for this, no reason to integrate it into winit, is there?

@quininer
Copy link

@torkleyy At least within the x11, there is advantage in integrate the clipboard into winit. This will avoid create redundant window and additional event loops.

@torkleyy
Copy link
Contributor

Ah I see, thanks!

@elinorbgr
Copy link
Contributor

For the record, on wayland clipboard handling is linked to keyboard focus, and cannot be done from an external crate independently of winit. As such, clipboard support in wayland would require either:

  • to be fully implemented in winit
  • or that winit expose a significant part of its internals (its SCTK inner) in the platform-specific part of the API

@trimental
Copy link
Contributor

trimental commented Aug 26, 2018

After some testing I've found that the clipboard can be accessed from wayland with the current winit methods without any needed change. Its a bit tedious but you can use Display::from_external_display() to access an EventQueue which can be used to create an Environment object; which can be used to make a WlSeat object; which can be used to make a DataDevice object which can access the clipboard.

@chrisduerr
Copy link
Contributor

Since @trimental did some great pathfinding in Alacritty to support this as an external crate, I'd propose closing this issue since @Osspial has mentioned that the tendency is to declare this out of scope.

I think it should be possible to provide this to all winit users without actually having to integrate it directly into winit. That would remove strain from the winit project and I think that since Alacritty is already maintaining a clipboard library, it shouldn't be too much of an issue.

And of course since this would be completely disconnected from Alacritty itself (hopefully), nothing should stop people from contributing to the clipboard library too. The only potential risk I can see is that Alacritty would be 'in control', however hopefully that shouldn't be an issue.

I've also looked into making use of a more standardized crate like clipboard from servo and I think there are a lot of options, but all of them would benefit from a definite decision to mark this either in, or out of scope.

Of course I don't want to monopolize this as something Alacritty will resolve, I'm just offering this as a potential solution. If there are others interested in branching off, it shouldn't keep them from implementing alternatives either.

@Osspial Osspial closed this as completed Feb 9, 2019
@chrisduerr
Copy link
Contributor

For everyone interested, an initial version of a potential wayland clipboard solution can be found here (100% of the credit goes to trimental for his great work):
https://github.com/Smithay/wayland-clipboard

@madsmtm
Copy link
Member

madsmtm commented Jan 27, 2022

We're discussing this again in #2156, for the people following this issue, feel free to drop by and give input!

madsmtm pushed a commit to madsmtm/winit that referenced this issue Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D - hard Likely harder than most tasks here H - help wanted Someone please save us P - normal Great to have S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

10 participants