[Spice-devel] [spice-gtk v3 1/3] gtk-session: clipboard: document owner-changed event
Victor Toso
victortoso at redhat.com
Tue Jan 15 09:32:22 UTC 2019
Hi,
On Mon, Jan 14, 2019 at 10:15:04PM +0100, Jakub Janku wrote:
> > The comment refers to the gtk_clipboard_clear() not
> > owner-changed event so you are right, of course. This comment
> > was probably a left over from different interactions that I
> > did in this code :(
> >
> > I'll send a fix for the documentation.
> >
> > For the other changes, I'd love to hear your opinion too. Did
> > not get 2/3 and 3/3 patches acked but more keen to discuss
> > the idea.
> >
> > I was wrong in regards to clipboard managers on Wayland, that
> > is, clipboard managers on Wayland *can* get clipboard data of
> > spice-gtk while spice-gtk's widgets are holding the focus :(
>
> That's weird. I didn't think this was possible.
> I've just had a very brief look at the code of GPaste:
>
> https://github.com/Keruspe/GPaste/blob/master/src/daemon/gpaste-daemon.c
>
> the main function includes the following lines:
> | /* FIXME: remove this once gtk supports clipboard correctly
> on wayland */
> | gdk_set_allowed_backends ("x11");
> This probably indicates that the clipboard manager actually runs on
> XWayland, which would explain why it's able to eavesdrop on the
> clipboard without having focus.
> It is the same "workaround" that we use in vdagent.
Ah, good. Interesting that remote-viewer running on Wayland could
have its clipboard data fetched by another application running
with x11 backend.
> > I didn't check how that happen but I'd rather avoid/deny that to
> > happen..
> >
> > Thanks again Jakub,
> >
> > > > + if (gtk_clipboard_get_owner(clipboard) == G_OBJECT(self)) {
> > > > + return;
> > > > + }
> > > > +
> > > > + s->clipboard_by_guest[selection] = FALSE;
> > > > + s->clip_hasdata[selection] = TRUE;
> > > > + if (s->auto_clipboard_enable && !read_only(self))
> > > > + gtk_clipboard_request_targets(clipboard, clipboard_get_targets,
> > > > + get_weak_ref(self));
> > > > }
> > > >
> > > > typedef struct
> > > > --
> > > > 2.20.1
> > > >
> > >
> > > Cheers,
> > > Jakub
> >
> >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190115/f66e8283/attachment.sig>
More information about the Spice-devel
mailing list