<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - client to guest primary selection not working on Wayland (F25) with something already selected in the guest"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101353#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - client to guest primary selection not working on Wayland (F25) with something already selected in the guest"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101353">bug 101353</a>
              from <span class="vcard"><a class="email" href="mailto:janku.jakub.jj@gmail.com" title="Jakub Janků <janku.jakub.jj@gmail.com>"> <span class="fn">Jakub Janků</span></a>
</span></b>
        <pre>(In reply to Christophe Fergeau from <a href="show_bug.cgi?id=101353#c3">comment #3</a>)
<span class="quote">> 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 :(</span >

That's true, on Wayland the owner-change signal is emitted once the window
gains keyboard focus (see subsection "Selection" on
<a href="https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing">https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing</a>
).

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
<a href="https://github.com/jjanku/spice-gtk/commit/bf57fb2a31577f975855d60be407292f9ac5b594">https://github.com/jjanku/spice-gtk/commit/bf57fb2a31577f975855d60be407292f9ac5b594</a>
Could you please give it a try?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>