Code Monkey home page Code Monkey logo

Comments (16)

woelper avatar woelper commented on June 2, 2024 1

I think enabling it as default in general makes sense - it sounds a feature might not even be needed.

from oculante.

woelper avatar woelper commented on June 2, 2024

This feature is already available. Could you try it out and see if it is working for you? It can be found in the menu to the right, then select "Paste".

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

I was expecting it to work with Ctrl V. Strange that it doesn't. Either way, clicking the menu button, tells me the clipboard does not contain an image. If I use wl-paste > image.png I am able to open and view the image. It is from grim.

from oculante.

woelper avatar woelper commented on June 2, 2024

Yes, that seems to be a bug - it should work with the key combination. I have not used wl-paste myself - I have tried this by copying images from different graphics applications. Basically, there need to be bytes in the clipboard that the image library can decode.

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

Well the data is put into the clipboard with grim, using --copy -t png

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

If I copy the image with wl-copy -t image/png < "$image_path" it does not work.

from oculante.

woelper avatar woelper commented on June 2, 2024

Have you tried copying from something like gimp or a screenshot utility as well? Does that produce a similar effect?

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

No it does not work.wkth himp or any program. The issue appears to not be that the keybimd.doesnt.work, it is that clipboard is broken on Wayland. Consider using another cross-desktop (XDG) compatible clipboard crate?

from oculante.

woelper avatar woelper commented on June 2, 2024

The keybinding is actually broken, so it is great you spotted that!
The library says:

There's also an optional wayland data control backend through the wl-clipboard-rs crate. This can be enabled using the wayland-data-control feature. When enabled this will be prioritized over the X11 backend, but if the initialization fails, the implementation falls back to using the X11 protocol automatically. Note that in my tests the wayland backend did not keep the clipboard contents after the process exited. (Although neither did the X11 backend on my Wayland setup).

I am not sure if there even is another cross-platform clipboard crate...

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

Could you please re-export the wayland-data-control feature as wayland-clipboard in the Cargo.toml and maybe make it a default-features?

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

There is currently:

The second one looks like a good option as I am not sure if the first (a fork of another crate, to add Wayland support) did it properly. For windowed applications, the clipboard is supposed to be associated with the window, and I see that some of these crates use the protocol intended for headless programs.

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

Arboard currently has a warning in the readme:

Note that in my tests the wayland backend did not keep the clipboard contents after the process exited. (Although neither did the X11 backend on my Wayland setup).

from oculante.

woelper avatar woelper commented on June 2, 2024

It does not look like copypasta supports image data as far as I see

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

If the feature flag works then it works but it might not behave as desired under all circumstances.

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

No matter what, seems like the answer is that no rust crates can talk to a WL clipboard using the window handle. https://smithay.github.io/smithay-clipboard/smithay_clipboard/struct.Clipboard.html Not even Smithay.

So maybe the protocol needs to be built manually for some reason? It is unstable?

https://docs.rs/eframe/latest/eframe/struct.Frame.html#method.window_handle

We can use a window handle from eframe and port wl-copy code to Smithay's bindings:

https://github.com/bugaevc/wl-clipboard/blob/master/src/wl-copy.c

Obviously this is a separate crate now. Yet Another Clipboard Crate But With Proper Wayland Support

YACCBWPWS

from oculante.

spikespaz avatar spikespaz commented on June 2, 2024

I don't know what this does but it looks like it works to get around the other problem
https://github.com/Kirottu/watershot/blob/master/src/main.rs#L72-L90

from oculante.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.