[Wayland-bugs] [Bug 768177] New: CLIPBOARD target request after PRIMARY request times out. GDK_SELECTION_NOTIFY has wrong selection id

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Wed Jun 29 12:20:38 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=768177

            Bug ID: 768177
           Summary: CLIPBOARD target request after PRIMARY request times
                    out. GDK_SELECTION_NOTIFY has wrong selection id
    Classification: Platform
           Product: gtk+
           Version: 3.20.x
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Backend: Wayland
          Assignee: gtk-bugs at gtk.org
          Reporter: caolanm at redhat.com
        QA Contact: gtk-bugs at gtk.org
                CC: rob at robster.org.uk, wayland-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 330565
  --> https://bugzilla.gnome.org/attachment.cgi?id=330565&action=edit
this makes it work for me

LibreOffice under wayland won't successfully paste from the CLIPBOARD after the
PRIMARY selection is used to paste from another app into it.

I paste from PRIMARY and then immediately request the targets of CLIPBOARD:
selection_buffer_notify generates a GDK_SELECTION_NOTIFY event for this
CLIPBOARD request using selection_buffer_notify but sets the selection field to
PRIMARY from the passed in SelectionBuffer.

So the notification dosn't match in _gtk_selection_notify at the
info->selection == event->selection so the CLIPBOARD request is never satisfied
and times out.

The problem appears to be the cache used by
_gdk_wayland_display_convert_selection of gdk/wayland/gdkselection-wayland.c
where...

  buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
                                     target);

...

  g_hash_table_insert (wayland_selection->selection_buffers,
                       GDK_ATOM_TO_POINTER (target),
                       buffer_data);

So the buffer_data for the PRIMARY selection was cached and reused for the
CLIPBOARD selection. The attached patch "for for me(tm)" by just updating the
selection of the cached buffer_data to the requested selection on retrieval

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160629/2b99258c/attachment.html>


More information about the wayland-bugs mailing list