After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768887 - Can't paste text copied in from QT5 Wayland clients
Can't paste text copied in from QT5 Wayland clients
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-16 15:14 UTC by Jonas Ådahl
Modified: 2021-07-05 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Allow interoperation between v1 drag source and v3 drag dest (1.55 KB, patch)
2017-11-02 15:04 UTC, Carlos Garnacho
accepted-commit_now Details | Review
wayland: Allow interoperability between v3 drag source and v1 drag dest (1.20 KB, patch)
2017-11-02 15:04 UTC, Carlos Garnacho
accepted-commit_now Details | Review

Description Jonas Ådahl 2016-07-16 15:14:02 UTC
GTK+ doesn't seem to be able to paste text copied from a QT5 client running with the Wayland QT backend.

Steps to reproduce:

1. Open some gtk3 application using the Wayland backend where you can paste text (such as gedit or gtk3-demo -> entry)
2. Open some QT5 client using the Wayland backend (I used "./application -platform wayland" in /usr/lib64/qt5/examples/widgets/mainwindows/application on my system.
3. Enter some text in the QT5 client
4. Copy said text
5. Paste in the client opened in step 1

Result:

Nothing is pasted

Expected result:

The copied text is pasted

Note that pasting the text using weston-terminal works fine.
Comment 1 Matthias Clasen 2016-08-11 14:55:11 UTC
Did we make any progress on this ?
Comment 2 Strangiato 2017-03-03 13:19:55 UTC
Tested on Arch running qt5 apps under Wayland: this problem is still present.
Comment 3 Strangiato 2017-11-01 20:01:47 UTC
Same problem on Gnome 3.26.1, Arch linux.
Comment 4 Carlos Garnacho 2017-11-02 15:04:04 UTC
QT5 implements version 1 of the wl_data_device_manager protocol interface, whereas mutter/gtk+ implement up to version 3 of this interface.

There is indeed an interoperation bug between v1 and v3 (which is in mutter, so reassigning the bug there), but someone should file a bug to QT and tell them not to use outdated and fundamentally broken versions of the protocol.
Comment 5 Carlos Garnacho 2017-11-02 15:04:47 UTC
Created attachment 362835 [details] [review]
wayland: Allow interoperation between v1 drag source and v3 drag dest

Since v1 of wl_data_device_manager does not have actions, explicitly
assume a "copy" one from the drag source.
Comment 6 Carlos Garnacho 2017-11-02 15:04:53 UTC
Created attachment 362836 [details] [review]
wayland: Allow interoperability between v3 drag source and v1 drag dest

Since v1 of wl_data_device_manager does not have actions, assume a "copy"
one from the drag destination.
Comment 7 Jonas Ådahl 2017-11-02 15:31:47 UTC
Review of attachment 362835 [details] [review]:

lgtm.
Comment 8 Jonas Ådahl 2017-11-02 15:32:02 UTC
Review of attachment 362836 [details] [review]:

lgtm.
Comment 9 Carlos Garnacho 2017-11-02 18:49:18 UTC
I just noticed thought that the original bug description said "paste". c&p seemed to work here at first glance, on a closer look it seems what is broken is pasting through the context menu.

Apparently QT5 does always issue wl_data_offer_destroy() on wl_keyboard.leave (Despite the keyboard focus immediately going to the popup). Probably the wl_data_device.selection docs stating:

  The data_offer is valid until a new data_offer or NULL is received
  or until the client loses keyboard focus.  The client must
  destroy the previous selection data_offer, if any, upon receiving
  this event.

Must have mistaken them into thinking it's ok to destroy the offer on wl_keyboard.leave. So it seems now we have 2 bugs to file :).
Comment 10 Jonas Ådahl 2017-11-03 03:14:07 UTC
It could easily be interpreted as that way I guess. What would be the point of keeping it around when not having any keyboard focus?

Either way, after the keyboard focus has been transfered to the popup, we should send a new offer anyway right? Is QT not using that one correctly?


(off topic: we should disassociate keyboard focus with offer availability, especially since touch devices might not have a keyboard)
Comment 11 Strangiato 2018-06-07 22:09:59 UTC
problem persists in gnome 3.28.2 + Qt 5.11.
Comment 12 Strangiato 2019-10-12 16:48:52 UTC
This bug is intermittent on Arch Linux running Gnome 3.34.2.
I can paste text copied from notepadqq running natively on Wayland into my internet browser (Opera)
running on Xwayland, but I can`t paste the same text into leafpad (gtk2) text editor also running on Xwayland.
Comment 13 GNOME Infrastructure Team 2021-07-05 13:52:52 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.