Copy from Firefox Wayland fails to be pasted anywhere else

Bug #1913775 reported by Stefano Maffulli
96
This bug affects 16 people
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Unknown
gtk+3.0 (Ubuntu)
Fix Released
High
Sebastien Bacher
Impish
Fix Released
High
Unassigned

Bug Description

* Impact

The clipboard copies from GTK based software sometime stop working under wayland

* Test Case

- in a wayland session try to copy text between software, from firefox to gedit for example, it should work in a consistent manner

alternative testcase inspired from the gitlab ticket
- install wl-clipboard
- use evince to open a pdf
- select and copy some content
- on a cmdline do
$ wl-paste -t TEXT
- try to paste then in another software, gedit for example

the copied text should be pasted

* Regression potential

The changes are in the wayland selection source so the impact should only be for wayland users and limited to clipboard interactions

------------------

Running Firefox 84.0.2 for Ubuntu Canonical-1.0 on Ubuntu 20.04.1 LTS, on Wayland native

Version 84.0.2
Build ID 20210105180113

Window Protocol wayland
Desktop Environment gnome

DESCRIPTION OF THE PROBLEM:

If I copy text from a web page and try to paste it into another Firefox page, the text is pasted correctly.

If I copy text from a web page and try to paste it in [gedit, libreoffice, thunderbird, terminal, slack (electron)] nothing happens. The Gnome Clipboard extension stays empty when content is copied from Firefox Wayland.

Pasting *from* another app *to* Firefox works fine.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :
Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

Please let me know if you need any more information to further debug this issue.

Revision history for this message
Frédéric Grosshans (fgrosshans) wrote :

I confirm this bug is still active on firefox 92.0+build3-0ubuntu0.21.04.1

Revision history for this message
Olivier Tilloy (osomon) wrote :

I think I have occasionally observed this problem, although I wasn't sure which component was at fault. I cannot seem to find an upstream bug tracking this issue, would you mind filing one at https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CFirefox, and sharing the link to it here? Thanks!

Revision history for this message
Edgar Rocha Alves (headgaar) wrote :

I confirm this bug on firefox 92.0 - ubuntu 21.04

Revision history for this message
Vijay Prema (vijay-prema) wrote :

I'm still seeing this bug (not every time, but multiple instances in a day) in Ubuntu 21.10 Wayland, Firefox 94.0.

David (dcorneli)
Changed in firefox (Ubuntu):
assignee: nobody → David (dcorneli)
assignee: David (dcorneli) → nobody
Revision history for this message
Linux Admin (8tomato) wrote :

I am experiencing this problem as well.
Initially when I just start FF I am able to copy from it to other apps, but quite soon (5-15 min) ability to copy text breaks.

Ubuntu 21.04 Wyaland
FF: 94.0+build3-0ubuntu0.21.04.1
XWayland: 2:21.1.1-0ubuntu1

Revision history for this message
Kain (kain-kain) wrote :

I believe this is the same as this wayland/gtk+-3 bug: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1953694

Revision history for this message
Olivier Tilloy (osomon) wrote :

Indeed, and this appears to be a GTK bug (https://gitlab.gnome.org/GNOME/gtk/-/issues/4340), for which a fix was merged a week ago.

For reference, the upstream firefox bug was https://bugzilla.mozilla.org/show_bug.cgi?id=1722369.

Changed in firefox (Ubuntu):
status: Confirmed → Invalid
tags: added: rls-jj-incoming
Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → High
status: New → Fix Committed
Changed in gtk+3.0 (Ubuntu):
assignee: nobody → Sebastien Bacher (seb128)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.24.30-3ubuntu2

---------------
gtk+3.0 (3.24.30-3ubuntu2) jammy; urgency=medium

  * debian/patches/git_wayland_clipboard.patch:
    - wayland: Ensure clipboard handling doesn't lock up in certain
      corner cases, fix copy from firefox being unreliable (lp: #1913775)

 -- Sebastien Bacher <email address hidden> Fri, 17 Dec 2021 16:09:39 +0100

Changed in gtk+3.0 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Kain (kain-kain) wrote :

Will there be a port of this fix to impish?

Revision history for this message
bluppfisk (bluppfisk) wrote :

I would also like to request a port of this fix to impish and hirsute.

I've currently worked around this by upgrading gtk+3.0 in a probably slightly unorthodox way, but I'd much prefer if the package was offered through the official Ubuntu impish repository.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Unlikely to happen for hirsute, which will be EOL on January 20.
Tagging for consideration in impish.

tags: added: rls-ii-incoming
tags: removed: rls-jj-incoming
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

untagging, I'm handling the SRU now

tags: removed: rls-ii-incoming
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Stefano, or anyone else affected,

Accepted gtk+3.0 into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gtk+3.0/3.24.30-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gtk+3.0 (Ubuntu Impish):
status: New → Fix Committed
tags: added: verification-needed verification-needed-impish
Revision history for this message
bluppfisk (bluppfisk) wrote :

Excellent news.

I've previously installed:

libgtk-3-common/now 3.24.30-3ubuntu2

and its dependencies from jammy and I've not seen the problem re-appear for a while. Is this the exact same software? In that case I'd vouch for the bug being solved.

That said, I'd feel more comfortable installing from the impish-proposed repo, but I'm a little confused about how to, even with the guide. I've activated impish-proposed, added the preferences file, but I'm unsure what I should put or search for as the package name, so I put * which I assume stands for "all". Using aptitude, however, I couldn't find a package called "gtk+3.0". Should I just take libgtk-3-0_3.24.30-1ubuntu1.1_i386.deb?

And will this install nicely over my (newer?) 3.24.30-3ubuntu2?

Revision history for this message
Olivier Tilloy (osomon) wrote :

bluppfisk, if you have installed the jammy packages on impish, enabling impish-proposed won't offer the update because the version is greater in jammy.

You will need to specify the version number to downgrade to the impish proposed update:

  sudo apt install libgtk-3-common=3.24.30-1ubuntu1.1 \
    libgtk-3-0=3.24.30-1ubuntu1.1 libgtk-3-bin=3.24.30-1ubuntu1.1 \
    gtk-update-icon-cache=3.24.30-1ubuntu1.1 gir1.2-gtk-3.0=3.24.30-1ubuntu1.1

Revision history for this message
bluppfisk (bluppfisk) wrote :

Thanks. I also just wanted to be sure that I was installing the right packages. May I ask, how did you know that these are the ones you need to apt install?

I'm confused because the official package is called gtk+3.0 but when I use apt I need to specify all of those? Those are also fewer packages than listed in on the Launchpad page's "binaries built by this package".

Anyway I've now successfully installed the packages above. This doesn't require a reboot, does it?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Those are the packages that are typically installed by default for this specific source package. It is possible that you have installed additional binary packages (such as libgtk-3-dev or libgtk-3-doc), in which case you would need to manually downgrade those, too.

The source package is called gtk+3.0, and a number of binary packages are built out of this source package. What you install on your machine are binary packages, but Launchpad handles source packages.
If you need to know the source package for a given binary package, you can use e.g.:

    apt show libgtk-3-bin | grep Source:

This specific update won't require a reboot, but I'm not sure whether it requires restarting the current wayland session, or if the fix will be picked up by individual client applications.
@seb128 maybe that could be clarified in the test case?

Mathew Hodson (mhodson)
no longer affects: firefox (Ubuntu)
Mathew Hodson (mhodson)
Changed in gtk+3.0 (Ubuntu Impish):
importance: Undecided → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

We haven't got new reports since the fix landed nor visible regression so let's say the fix is working as intended.

tags: added: verification-done verification-done-impish
removed: verification-needed verification-needed-impish
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (gtk+3.0/3.24.30-1ubuntu1.1)

All autopkgtests for the newly accepted gtk+3.0 (3.24.30-1ubuntu1.1) for impish have finished running.
The following regressions have been reported in tests triggered by the package:

apport/2.20.11-0ubuntu71 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/impish/update_excuses.html#gtk+3.0

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for gtk+3.0 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.24.30-1ubuntu1.1

---------------
gtk+3.0 (3.24.30-1ubuntu1.1) impish; urgency=medium

  * debian/patches/git_wayland_clipboard.patch:
    - wayland: Ensure clipboard handling doesn't lock up in certain
      corner cases, fix copy from firefox being unreliable (lp: #1913775)

 -- Sebastien Bacher <email address hidden> Wed, 12 Jan 2022 12:44:47 +0100

Changed in gtk+3.0 (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote :

Yeah, ok.

Changed in gtk:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.