#977693 gtk+3.0: Wayland primary selection interoperability with GTK clients on Plasma Desktop

Package:
src:gtk+3.0
Source:
gtk+3.0
Submitter:
Sandro Knauß
Date:
2020-12-24 17:45:20 UTC
Severity:
normal
Tags:
#977693#5
Date:
2020-12-19 01:06:49 UTC
From:
To:
Hey,

currently it is impossible to use middle click pasting between Wayland
clients and GTK clients running on XWayland, like for example Chromium
and Firefox on Plasma Desktop.

KDE implemented the standard protocol (zwp_primary_selection) a while
ago: https://bugs.kde.org/show_bug.cgi?id=422426

Whereas GTK support landed only last month, missing the 3.24.23 dot
release: https://gitlab.gnome.org/GNOME/gtk/-/issues/2591

Upstream GTK developer Emmanuele Bassi said that there are no more gtk3
dot releases planned (at least not before GTK 4.0 is released).
Emmanuale recommends cherry-picking this patch from the gtk-3-24 stable
branch to distro packages:

https://gitlab.gnome.org/GNOME/gtk/-/commit/9a693c7228a88b76a007aed41b101d89d084cf9b

Can you do this backport?

To verify that the patch works:
1. Log into a Plasma Wayland session
2. Open a gtk3 client using X11, such as Chromium or Firefox
3. Select some text
4. Open any Wayland client, for example Konsole
5. Try pasting the text with the middle mouse button

Regards

hefee

Link to original email of the KDE distributions list:
https://mail.kde.org/pipermail/distributions/2020-November/000890.html

#977693#10
Date:
2020-12-19 12:17:05 UTC
From:
To:
Control: found -1 3.24.23-3
Control: notfound -1 3.24.24-1
Control: tags -1 + moreinfo

Are you sure this isn't already present in testing and unstable's
libgtk-3-0? The primary-selection-unstable-v1 protocol was mentioned in
the upstream NEWS file for 3.24.24.
(I uploaded it to experimental NEW since it has a new SONAME and needs
a newer version of Pango), and a 3.24.24 point release also happened.

That's included in 3.24.24, in testing since 2020-12-14.

I'll try to test this at some point, but it's very likely to be quicker
for a Plasma user to upgrade their GTK 3 version than it is for me to
install Plasma.

This is not a fully interoperable protocol until it's declared stable
by the Wayland developers, and the stable version is implemented by GTK,
Plasma, GNOME Shell, and any other relevant toolkits such as Qt. However,
it seems to be very similar to the older GTK-specific primary selection
interface (perhaps identical except for changing the names), so hopefully
having the GTK version, the standardized unstable version and a future
standardized stable version all exist in parallel for a few months/years
won't be a significant maintenance burden for the various projects
involved.

It would probably be pragmatic for Plasma to implement the GTK-specific
interface too, at least for a while, if they're as similar as they seem
to be from the GTK change - that would make sure it interoperates with
older GTK versions, for instance in Flatpak/Snap apps that are stuck on
an older runtime, apps from a Debian 10 chroot, or the Debian-10-based
Steam Runtime.

    smcv

#977693#21
Date:
2020-12-19 18:36:46 UTC
From:
To:
Hey,

great.

Thanks for this info.

I tested it on my machine (Debian unstable with libgtk-3-common 3.24.24-1) and
still I cannot copy text from Firefox to other clients.

I'll forward your text to the distributions mailinglist, as I'm not an
upstream developer of Plasma. And the primary mail with the request for
backport came from the plasma team.

regards,

hefee