Bug 1877230

Summary: Middle-click doesn't paste text between Wayland and XWayland clients
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: gtk3Assignee: Matthias Clasen <mclasen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: bernie+fedora, cosimo.cecchi, gnome-sig, htl10, jgrulich, kde-sig, mclasen, me, m.lincetto, ncross, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-27 16:51:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1882465    

Description Daniel Mach 2020-09-09 06:56:59 UTC
Description of problem:
Middle-click doesn't paste text in Wayland

Version-Release number of selected component (if applicable):
konsole5-20.08.0-1.fc34.x86_64
kwin-wayland-5.19.5-1.fc34.x86_64

How reproducible:
always

Steps to Reproduce:
1. Start Plasma/Wayland session
2. open Konsole
3. select a text and middle-click to paste it

Actual results:
nothing happens

Expected results:
text gets pasted

Additional info:
works fin in Xorg

Comment 1 Hin-Tak Leung 2020-11-04 01:51:03 UTC
It does not work under gnome + wayland either (but works with gnome + X11 and plasma + X11). Apparently this should go under libinput ?

Comment 2 Ben Cotton 2021-02-09 15:18:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 3 Massimiliano L. 2021-03-30 12:42:10 UTC
This is partially but not completely solved, cfr. https://pointieststick.com/2020/06/05/this-week-in-kde-okular-konsole-plasma-and-wayland/

On the KDE Spin of Fedora 34 Beta, middle click paste between Firefox and KWrite (as an example) still does not work.

Possibly it is related to this bug https://bugs.kde.org/show_bug.cgi?id=422426 for which there may be a GTK fix upstream(?)

Comment 4 Rex Dieter 2021-03-30 13:14:59 UTC
Yes, some issue(s) remain with gtk interoperability (that needs fixing on gtk side).

Comment 5 Rex Dieter 2021-03-30 13:17:16 UTC
In particular,
https://gitlab.gnome.org/GNOME/gtk/-/issues/3791

Comment 6 Bernie Innocenti 2021-04-14 07:17:14 UTC
The fix has already been soaking in the gtk-3-24 branch for 2 weeks:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3357

Could we add this patch to the Fedora gtk3 package now, instead of waiting for gtk 3.24.29?

Comment 7 Bernie Innocenti 2021-04-14 07:29:05 UTC
The fix for master seems to have made it into gtk 4.2.0 by a few minutes:
https://gitlab.gnome.org/GNOME/gtk/-/commit/fb48699ba41813fc5c34c60958f94aa465ef1d98

Comment 8 Bernie Innocenti 2021-04-24 14:19:19 UTC
gtk 3.24.29 was released today, and is already packaged in Arch Linux, so I tested there.

Primary selection now works fine between a Qt app (konsole) and most GTK3 apps (gnome-disks, seahorse, tilix).

However, it still fails between Qt apps and Chrome, Firefox, Thunderbird or Signal Desktop.

I checked, and these binaries are using the new libgtk-3.so:

  % cat /proc/$(pidof -s chrome)/maps | grep -m1 gtk 
  7fab70d09000-7fab70d8c000 r--p 00000000 103:03 17587682                  /usr/lib/libgtk-3.so.0.2404.25
  % cat /proc/$(pidof -s thunderbird-bin)/maps | grep -m1 gtk 
  7f87486d7000-7f874875a000 r--p 00000000 103:03 17587682                  /usr/lib/libgtk-3.so.0.2404.25

The only difference I can see is that gnome-disks, seahorse and tilix are Wayland clients, while Firefox, Chrome, Thunderbird and Signal Desktop are X11 clients.

Comment 9 Bernie Innocenti 2021-04-24 15:25:55 UTC
This is another known issue with no fix in sight:

"Primary selection will still not work between QT-Wayland and e.g. Chromium or Pidgin. In order to fix that kwin will need to translate between primary selection of Wayland and X11 - that's not yet done, so the bug should get reopened."
https://bugs.kde.org/show_bug.cgi?id=422426#c24

Comment 10 Rex Dieter 2021-04-27 16:47:59 UTC
I confirm that f34 shipped with (patched) gtk3-3.24.29-1.fc34 (in updates)

So gtk side of this should be good to go, just need the primary selection translation on plasma side.  I'll probably open a separate bug for that, and close this one, any objections?

Comment 11 Rex Dieter 2021-04-27 16:51:50 UTC
new bug #1954147 , closing this one.