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

Support Wayland #53

Open
ghost opened this issue Jul 21, 2017 · 10 comments
Open

Support Wayland #53

ghost opened this issue Jul 21, 2017 · 10 comments

Comments

@ghost
Copy link

ghost commented Jul 21, 2017

Currently clipster fails on wayland (wm: sway). The stacktrace reports that libwnck is "designed to work under X11 only".

I fear this is going to be difficult to fix. If I understand correctly, wayland makes getting data from other windows very difficult (for security reasons). Clipit too doesn't run on wayland.

@ghost
Copy link
Author

ghost commented Jul 22, 2017

@mrichar1
Copy link
Owner

mrichar1 commented Jul 22, 2017

Thanks for raising this - I've been mostly trying to ignore it 😃

My reading up on this (along with your Gnome bug report) makes it clear that this is a complicated migration. As such there's a possibility that moving to Wayland might be a 'start again' kind of operation, rather than an update to the current app.

I'll leave this bug open as a place to gather more information on how the clipboard will work in Wayland, and in case anyone else wants to know about support, but for now this is definitely a 'wait and see' situation.

@mrichar1
Copy link
Owner

Thanks for the extra info!

I'm still not quite at the point where I can put any effort into looking at wayland support (for one thing I don't have wayland running anywhere handy) though I will have to at some point. It looks like Gtk+ has extended their clipboard module to support Wayland, though documentation is really thin on the ground, so I've no idea to what extent things will 'just work'.

libwnck is used by filter_classes by application - this is going to have to be refactored anyway if my understanding of how the wayland clipboard works is correct.

It'd be interesting if anyone with wayland running can edit clipster and comment out the following lines:

try:
    require_version("Wnck", "3.0")
    from gi.repository import Wnck
except (ImportError, ValueError):

and unindent Wnck = None

and see what happens when clipster is run (with filter_classes = no in the config)?

@ghost
Copy link
Author

ghost commented Dec 19, 2017

I tried it some time ago, but it wasn't enough because wayland applications don't get notified of ownership changes, so the core functionality is broken too. I believe that window managers will need to implement the listening part, whereas clipboard managers will just retrieve the info when asked by the user — very very simplified code, but will need custom retrievers for each window manager.
You can follow this sway issue and this other for their (TBD) api, which will probably work for all wlroots-based wms.

@glubsy
Copy link
Contributor

glubsy commented Jan 5, 2018

libwnck is used by filter_classes by application - this is going to have to be refactored anyway if my understanding of how the wayland clipboard works is correct.

If you ever get around to refactor it, may I suggest to make the filter inclusive instead of exclusive? By that I mean, only programs included in the filter will get processed, like a whitelist (instead of a blacklist currently).

@mrichar1
Copy link
Owner

@glubsy I think most people want a blacklist (the usual use case is collect everything except a password manager) hence the reason it was implemented that way.

I could make it so that there is both a blacklist and a whitelist (ordering/priority tbd...) if this is useful. Please can you make this a new issue as a feature request, as it will get lost in the wayland discussion, and if it in turn gets discussed will distract from the original issue. Thanks!

@zetorian
Copy link

@ghost, @mrichar1: the above mentioned wlroots implementation has been moved upstream
swaywm/wlr-protocols#25
and if your are interested, this project implements it:
https://github.com/bugaevc/wl-clipboard

wl-clipboard is a simple cli/pipes based application along the same vein of xclip, and might make a fairly trivial implementation, depending on how tightly you want to bind to wayland protocols.

@mrichar1
Copy link
Owner

@zetorian thanks for flagging this up! given that clipster is currrntly working at a high level using the Python Gtk libs, then it's unlikely that I can pursue any work on a wayland-clipster until a similar API/ABI exists in Gtk/Qt/other python lib. Of course if someone wanted to write a wrapper around the protocol that clipster could tie into... 😃

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
@mrichar1 mrichar1 reopened this Apr 28, 2022
@stale stale bot removed the stale label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants