qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 7/7] ui/gtk: add clipboard support


From: Marc-André Lureau
Subject: Re: [PATCH v2 7/7] ui/gtk: add clipboard support
Date: Wed, 24 Mar 2021 14:26:10 +0400

Hi

On Wed, Mar 24, 2021 at 2:16 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
  Hi,

> > +    if (gd->cbowner[s]) {
> > +        /* ignore notifications about our own grabs */
> > +        return;
> > +    }
> > +
> > +
> > +    switch (event->owner_change.reason) {
> > +    case GDK_SETTING_ACTION_NEW:
> > +        info = qemu_clipboard_info_new(&gd->cbpeer, s);
> > +        if (gtk_clipboard_wait_is_text_available(clipboard)) {
> > +            info->types[QEMU_CLIPBOARD_TYPE_TEXT].available = true;
> > +        }
> >
>
> Same comment as v1:
> So after gtk_clipboard_set_text() the client side is actually taking
> the ownership away from the guest clipboard I presume. That might have some
> weird interaction issues. Hopefully the other side isn't playing the same
> game...

The cbowner check above should avoid that ...

I fail to see how that works, imagine the other end is the same code (qemu in the guest), it will take clipboard ownership and it is in a endless loop, isn't it?

> > +    gd->gtkcb[QEMU_CLIPBOARD_SELECTION_CLIPBOARD] =
> > +        gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE));
>
> Why not use GDK_SELECTION_* ?

So I don't have to worry about converting GDK_SELECTION_* to
QEMU_CLIPBOARD_SELECTION_* ?


GDK_SELECTION* is gdk_atom_intern(*, FALSE)) afaik

--
Marc-André Lureau

reply via email to

[Prev in Thread] Current Thread [Next in Thread]