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 clipboard #72

Open
lizhuangs opened this issue Dec 10, 2019 · 7 comments
Open

support clipboard #72

lizhuangs opened this issue Dec 10, 2019 · 7 comments

Comments

@lizhuangs
Copy link

support copy image to clipboard,Tks~

@juherask
Copy link

I agree, this would be really nice feature.

@duckduck1
Copy link

Missing that feature, too. It would keep Viewnior simple but functional.

@JakkuSakura
Copy link

It would be very helpful to post pics in Github issues. Currently, I use my screenshot.

@ppdeassis
Copy link

Looking forward to it too.

@AlbertHamik
Copy link

Not to hijack this too much but would it be possible to do the reverse, pasting from clipboard into Viewnior? In Windows I often use the paste image feature of Irfanview to confirm how a screenshot turned out. If I need to start another thread for this I can.

@hajonnes
Copy link

hajonnes commented Apr 6, 2023

I agree, both functionalities would be really nice.

@cpontvieux-systra
Copy link

cpontvieux-systra commented Aug 27, 2024

Ristretto can do it, is free and is also in C, so it may be simple to borrow the code…

[Edit]
I found this:
https://gitlab.xfce.org/apps/ristretto/-/blame/master/src/main_window.c?ref_type=heads#L4314

{
    GdkPixbuf *pixbuf;
    RsttoImageViewer *viewer;
    viewer = RSTTO_IMAGE_VIEWER (window->priv->image_viewer);
    pixbuf = rstto_image_viewer_get_pixbuf (viewer);
    if (pixbuf)
    {
        gtk_clipboard_set_image (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), pixbuf);
        g_object_unref (pixbuf);
    }
}

GTK is already a dependency for Viewnor, the only requirement is to get a GdkPixBuf reference of the shown image, which should be pretty easy.
Official Gtk doc for clipboard

  • One new action should be added here and here
  • The UniImageView has a pixbuf attribute, so it’s all there
  • UNI_IMAGE_VIEW(window->view) seems to get the UniImageView from the widget
  • A new function should probably need to be added in some of the uni-XXX.c files

If nobody do it first, I may try to fill a merge request is the following days at is seems pretty simple.

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

9 participants