All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, QEMU <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH 7/7] ui/gtk: add clipboard support
Date: Wed, 3 Mar 2021 17:54:59 +0400	[thread overview]
Message-ID: <CAJ+F1CJV=BwYsZ70YVxQC+LXxzq_o3G3XCSa-nf=6V+MSqcQ4g@mail.gmail.com> (raw)
In-Reply-To: <20210303122014.gmgfgz462aa5vuya@sirius.home.kraxel.org>

[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]

Hi

On Wed, Mar 3, 2021 at 4:20 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

>   Hi,
>
> > > +    if (info != gd->cbinfo[s]) {
> > > +        qemu_clipboard_info_put(gd->cbinfo[s]);
> > > +        gd->cbinfo[s] = qemu_clipboard_info_get(info);
> > > +        gd->cbpending[s] = 0;
> > > +        if (!self_update) {
> > > +            if (info->types[QEMU_CLIPBOARD_TYPE_TEXT].available) {
> > > +                qemu_clipboard_request(info,
> QEMU_CLIPBOARD_TYPE_TEXT);
> >
> > Always requesting the clipboard is a bit harsh, isn't it?
> >
> > +            }
> > > +        }
> > > +        return;
> > > +    }
> > > +
> > > +    if (self_update) {
> > > +        return;
> > > +    }
> > > +
> > > +    if (info->types[QEMU_CLIPBOARD_TYPE_TEXT].available &&
> > > +        info->types[QEMU_CLIPBOARD_TYPE_TEXT].data) {
> > > +        gtk_clipboard_set_text(gd->gtkcb[s],
> > > +
>  info->types[QEMU_CLIPBOARD_TYPE_TEXT].data,
>
> Well, I want gtk deal with the compatibility stuff like all the
> different target names we have for text ("STRING", "text/plain", ...),
> and using gtk_clipboard_set_text() seems to be the only way to do that.
>
> I'm open to better ideas.
>
>
Basically implement an async version of the Gtk function:
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkclipboard.c#L850

Instead of "gtk_clipboard_set_with_data" taking a copy of the text,
implement the callbacks to request the data from the guest.

I am not sure about gtk_clipboard_set_can_store() interactions, it's
probably only when the application quits by default. I wouldn't worry about
it for now.


-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 2611 bytes --]

  reply	other threads:[~2021-03-03 13:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 13:13 [PATCH 0/7] ui: add vdagent implementation and clipboard support Gerd Hoffmann
2021-02-19 13:13 ` [PATCH 1/7] ui: add clipboard infrastructure Gerd Hoffmann
2021-02-19 13:13 ` [PATCH 2/7] ui/vdagent: core infrastructure Gerd Hoffmann
2021-02-25 18:24   ` Marc-André Lureau
2021-02-19 13:13 ` [PATCH 3/7] ui/vdagent: add mouse support Gerd Hoffmann
2021-02-19 13:13 ` [PATCH 4/7] ui/vdagent: add clipboard support Gerd Hoffmann
2021-02-25 18:37   ` Marc-André Lureau
2021-02-19 13:13 ` [PATCH 5/7] ui/vnc: " Gerd Hoffmann
2021-02-25 19:09   ` Marc-André Lureau
2021-03-03 12:13     ` Gerd Hoffmann
2021-03-03 14:27       ` Marc-André Lureau
2021-03-04  8:58         ` Gerd Hoffmann
2021-03-04 10:07           ` Gerd Hoffmann
2021-02-19 13:13 ` [PATCH 6/7] ui/gtk: move struct GtkDisplayState to ui/gtk.h Gerd Hoffmann
2021-02-19 13:13 ` [PATCH 7/7] ui/gtk: add clipboard support Gerd Hoffmann
2021-02-25 19:45   ` Marc-André Lureau
2021-03-03 12:20     ` Gerd Hoffmann
2021-03-03 13:54       ` Marc-André Lureau [this message]
2021-03-04  9:04         ` Gerd Hoffmann
2021-02-19 13:36 ` [PATCH 0/7] ui: add vdagent implementation and " no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ+F1CJV=BwYsZ70YVxQC+LXxzq_o3G3XCSa-nf=6V+MSqcQ4g@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.