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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]
     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.
_______________________________________________
wayland-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs

Reply via email to