client → guest primary selection not working on Wayland (F25) with something already selected in the guest
copying/pasting with gnome-terminal, both g-t and v-v run on wayland (gnome-shell: alt-F2 → "lg" → Windows → select one → check if there is GType:MetaWindowWayland… or GType:MetaWindowX11… in first line)
steps to reproduce:
1. connect to the guest
2. select something in the guest
3. select something in the client
4. paste in the guest
guest selection gets pasted
client selection gets pasted
until there is nothing selected in the guest, transferring primary selection from client to the guest works just fine
Wayland as the guest or the client
F25 guest on top of el7 hypervisor works so it must have been client (F25 or F26).
I started looking into a similar bug on f25 client a while ago, I went as far as the GtkClipboard::owner-change signal not being emitted (or being emitted differently than on X11) when running on wayland. Did not have time to dig further :(
(In reply to Christophe Fergeau from comment #3)
> I started looking into a similar bug on f25 client a while ago, I went as
> far as the GtkClipboard::owner-change signal not being emitted (or being
> emitted differently than on X11) when running on wayland. Did not have time
> to dig further :(
That's true, on Wayland the owner-change signal is emitted once the window gains keyboard focus (see subsection "Selection" on https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing ).
I came across similar issue, but with normal clipboard selection (Ctrl+C/Ctrl+V). Primary selection seems to work fine, most of the time anyway.
Tested on my machine, there seem to be multiple problems regarding clipboard selection:
- owner-change is emitted twice, when we call gtk_clipboard_set_with_owner()
- clipboard_clear() is not called at all
- gtk_clipboard_set_with_owner() returns SpiceGtkSession, although the ownership of the clipboard was taken by another client (so it should return NULL). This causes the issue described by David.
I think this might be a bug in GTK, but further investigation is needed...
I came up with a quick temporary fix, see
Could you please give it a try?
Filed a bug in GTK:
Bug concerning double emission of "owner-change" signal has already been reported:
(In reply to Jakub Janků from comment #5)
> Filed a bug in GTK:
This bug is now fixed in master and the gtk-3-22 branch (thanks Jakub for the very useful test case!), and in my testing this was fixing that issue. I'd prefer that we don't add the workaround to spice-gtk, and just make sure the patch is backported to the gtk+ we are using. I'll close this bug, just reopen it if you disagree and think we need the workaround, or if the gtk+ fix is not enough.