Re: [spice-gtk v4 1/2] gtk-session: improve doc on owner-changed

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

 



Hi,

On Mon, Jan 14, 2019 at 08:49:52PM +0100, Jakub Janku wrote:
> Hi,
> 
> On Mon, Jan 14, 2019 at 1:34 PM Victor Toso <victortoso@xxxxxxxxxx> wrote:
> >
> > From: Victor Toso <me@xxxxxxxxxxxxxx>
> >
> > * Sets -> Set (Jakub)
> > * Clarify when onwer-changed event is called with
> >   owner == self (Jakub)
> >
> > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
> > ---
> >  src/spice-gtk-session.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> > index adc72a2..abce43f 100644
> > --- a/src/spice-gtk-session.c
> > +++ b/src/spice-gtk-session.c
> > @@ -631,7 +631,7 @@ static void clipboard_get_targets(GtkClipboard *clipboard,
> >   * Situation 2: When spice-gtk holds the focus and is changing the clipboard by
> >   * either setting new content information with gtk_clipboard_set_with_owner() or
> >   * clearing up old content with gtk_clipboard_clear(). The main difference between
> > - * Wayland and X11 is that on X11, gtk_clipboard_clear() set the owner to none, which
> > + * Wayland and X11 is that on X11, gtk_clipboard_clear() sets the owner to none, which
> >   * emits owner-change event; On Wayland that does not happen as spice-gtk still is
> >   * the owner of the clipboard.
> >   */
> > @@ -668,8 +668,8 @@ static void clipboard_owner_change(GtkClipboard        *clipboard,
> >          return;
> >      }
> >
> > -    /* This situation happens when clipboard is being cleared by us, when agent
> > -     * sends a release-grab for instance */
> > +    /* This situation happens when clipboard is being set by us (grab message)
> 
> this is fine
> 
> > +     * and on X11 also when cleared by us (release-grab) */
> 
> But I don't understand why you added this.
> If spice-gtk receives release-grab from vdagent, it calls
> gtk_clipboard_clear(), then "owner-change" is emitted. In the
> callback, gtk_clipboard_get_owner() returns NULL, so the condition
> below evaluates as FALSE -- which is the case you're trying to handle
> in 2/2 of this series, if I'm not mistaken.
> 
> So I think this line should be removed.

I'm stupid. I've documented what I saw but indeed, again, not
pertinent to the check below. Thanks, I'll remove it.

> >      if (gtk_clipboard_get_owner(clipboard) == G_OBJECT(self)) {
> >          return;
> >      }
> > --
> > 2.20.1
> >
> Cheers,
> Jakub

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]