Bug 157373 - Using the Paste Special dialog ends in "Requested clipboard format is not available" error; can't reopen dialog after
Summary: Using the Paste Special dialog ends in "Requested clipboard format is not ava...
Status: RESOLVED DUPLICATE of bug 156562
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Wayland KDE, KF5 Paste-Special-Unformatted
  Show dependency treegraph
 
Reported: 2023-09-22 03:31 UTC by deppy.v2
Modified: 2024-05-11 09:11 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Information dialog error received on Paste Special (18.40 KB, image/png)
2023-09-22 03:33 UTC, deppy.v2
Details
Libre OFfice Specifications (122.93 KB, image/png)
2023-10-08 16:47 UTC, deppy.v2
Details
Screencast of it working on Debian testing (KDE Plasma Wayland) (5.55 MB, video/x-matroska)
2024-04-16 14:59 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deppy.v2 2023-09-22 03:31:01 UTC
Description:
When I do Paste Special and select Unformatted Text option I get an Information dialog reporting that 'Requested clipboard format is not available'. On slecting Paste or Paste Unfomatted text directly, the text is pasted with no complains

Steps to Reproduce:
1. Copy text
2. Do Paste Special
3. Receive information dialog, no text is pasted

Actual Results:
No text gets pasted

Expected Results:
Text should paste


Reproducible: Always


User Profile Reset: No

Additional Info:
Running Manjaro KDE, everything up to date
Comment 1 deppy.v2 2023-09-22 03:33:04 UTC
Created attachment 189750 [details]
Information dialog error received on Paste Special
Comment 2 Buovjaga 2023-10-03 15:51:10 UTC
Can you share the clipboard data in public? You might export it with https://github.com/hluk/CopyQ
Comment 3 deppy.v2 2023-10-03 16:29:51 UTC
It only happens using keyboard shortcut. When going through mouse options it works fine. I have made a short video you can check on Mega (https://mega.nz/file/3kQnibbK#a9B-eIcvEGLeJk2a4ZwlGzEp7TW9JOPgnxgbg2Qb3tY)
Comment 4 Buovjaga 2023-10-03 18:29:49 UTC
(In reply to deppy.v2 from comment #3)
> It only happens using keyboard shortcut. When going through mouse options it
> works fine. I have made a short video you can check on Mega
> (https://mega.nz/file/3kQnibbK#a9B-eIcvEGLeJk2a4ZwlGzEp7TW9JOPgnxgbg2Qb3tY)

Works fine for me to copy from KWrite and Paste Special with keyboard.

By the way, in the future you could record using https://obsproject.com/ or similar for a better experience and result.
Comment 5 deppy.v2 2023-10-04 00:58:00 UTC
It also only happens to me on Manjaro, and not the other laptop using Ubuntu
Comment 6 Stéphane Guillou (stragu) 2023-10-06 15:23:24 UTC
Other people are having the same error message recently (including one on Manjaro) in bug 68765. Enough to mark as "new".

Can you please check if you are using Wayland?
And can you see if you can reproduce in previous versions, e.g. 7.4 ?

Thank you!
Comment 7 Stéphane Guillou (stragu) 2023-10-06 15:26:08 UTC
Oh, an please share the full version information copied from Help > About LibreOffice.
Thank you!
Comment 8 deppy.v2 2023-10-08 10:03:19 UTC
It happens both on X11 or Wayland. Everything is updated. Sorry, I would not be able to try on older versions.
Comment 9 Buovjaga 2023-10-08 10:21:58 UTC
(In reply to deppy.v2 from comment #8)
> It happens both on X11 or Wayland. Everything is updated. Sorry, I would not
> be able to try on older versions.

Please copy and paste here the contents of your Help - About. This allows us to know more about your system.
Comment 10 deppy.v2 2023-10-08 16:42:41 UTC
Sure. Please check the attached image
Comment 11 deppy.v2 2023-10-08 16:47:01 UTC
Created attachment 190088 [details]
Libre OFfice Specifications

As requested, please find the about section screen
Comment 12 Buovjaga 2023-10-08 16:50:58 UTC
(In reply to deppy.v2 from comment #11)
> Created attachment 190088 [details]
> Libre OFfice Specifications
> 
> As requested, please find the about section screen

Thanks. Next time you can just click the button next to Version Information to copy the text.
Comment 13 Stéphane Guillou (stragu) 2024-04-12 12:57:54 UTC
*** Bug 160407 has been marked as a duplicate of this bug. ***
Comment 14 joey.joey586 2024-04-14 09:45:04 UTC
This bug also happens to me, but only under Wayland. Using X11 or XWayland with QT_QPA_PLATFORM=xcb allows Paste Special to work normally again.

Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 2; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+xcb)
Locale: en-US (C.UTF-8); UI: en-US
24.2.2-2
Calc: threaded
Comment 15 Stéphane Guillou (stragu) 2024-04-16 01:40:03 UTC
Reproduced with:

Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

As well as 7.0.0.3.

Copying text from Bugzilla, then pasting in Writer using the Ctrl + Shift + V dialog fails (tried both unformatted text and HTML).
After first try, it fails to open the Paste Special dialog a second time (until a new copy).

Not reproduced with gtk3 VCL plugin nor with kf5 (cairo+xcb). (Which is why I'm surprised by comment 8 - deppy, maybe you can test once more by launching LO like in comment 14?)

Michael, wondering if you have an idea about this one, following on your fix for bug 158947?
Comment 16 Michael Weghorn 2024-04-16 06:44:04 UTC
(In reply to Stéphane Guillou (stragu) from comment #15)
> Copying text from Bugzilla, then pasting in Writer using the Ctrl + Shift +
> V dialog fails (tried both unformatted text and HTML).
> After first try, it fails to open the Paste Special dialog a second time
> (until a new copy).
> 
> (...)
> 
> Michael, wondering if you have an idea about this one, following on your fix
> for bug 158947?

It works fine for me with either a local development build (git master) or a current TDF daily build.

But I can still reproduce the issue with 24.2.2.

So apparently something else is needed besides the fix for tdf#158947.
The fixes for tdf#156562 come to mind, and bibisecting actually points to

commit 1db5b87fe69c2375f1d66974dafcd563303c76db
Author: Michael Weghorn
Date:   Tue Feb 13 13:23:17 2024 +0100

    tdf#156562 qt: Sync with system clipboard content if necessary

as the commit from where on this starts.

I'm doing a local 24-2 build to see whether cherry-picking the tdf#156562 commits makes this work there as well.
Comment 17 Michael Weghorn 2024-04-16 07:16:12 UTC
(In reply to Michael Weghorn from comment #16)
> I'm doing a local 24-2 build to see whether cherry-picking the tdf#156562
> commits makes this work there as well.

It does.

-> closing as a duplicate of tdf#156562

Backports for 24-2 now pending in Gerrit:
https://gerrit.libreoffice.org/c/core/+/166140
https://gerrit.libreoffice.org/c/core/+/166141

*** This bug has been marked as a duplicate of bug 156562 ***
Comment 18 Stéphane Guillou (stragu) 2024-04-16 09:33:34 UTC
(In reply to Michael Weghorn from comment #17)
> It does. 
> Backports for 24-2 now pending in Gerrit
Fabulous, thank you for the quick response, Michael! :)
Comment 19 Stéphane Guillou (stragu) 2024-04-16 14:24:08 UTC
(In reply to Michael Weghorn from comment #16)
> It works fine for me with either a local development build (git master) or a
> current TDF daily build.
Actually, I can still reproduce in the latest daily build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bdf3b5ce49b0e4ee1b4525d344cfb037ef473059
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-AU (en_AU.UTF-8); UI: en-US

On Ubuntu 22.04 + GNOME 42.9. As described in comment 15. Am I missing something?
Comment 20 Michael Weghorn 2024-04-16 14:59:55 UTC
Created attachment 193707 [details]
Screencast of it working on Debian testing (KDE Plasma Wayland)
Comment 21 Michael Weghorn 2024-04-16 15:03:34 UTC
(In reply to Stéphane Guillou (stragu) from comment #19)
> Actually, I can still reproduce in the latest daily build:
> 
> Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: bdf3b5ce49b0e4ee1b4525d344cfb037ef473059
> CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> 
> On Ubuntu 22.04 + GNOME 42.9. As described in comment 15. Am I missing
> something?

It works for me with the exact same daily build in a KDE Plasma Wayland session on Debian testing, sample screencast copying from Firefox: attachment 193707 [details].

Do you notice any relevant difference in what we're doing (e.g. different browser, different kind of text copied,...)?

Versions of potentially relevant packages (might e.g. also be related to Qt version etc.):

* firefox-esr    115.9.1esr-1~deb12u1
* libqt5core5a:amd64 5.15.10+dfsg-7
* libqt5waylandclient5:amd64 5.15.10-2+b1
* kwin-wayland   4:5.27.10-1
Comment 22 Michael Weghorn 2024-04-16 15:10:10 UTC
@Stéphane: 
Note also that LO does not create a deep copy of the clipboard when you hit Ctrl+Shift+V, but pastes whatever is in the clipboard when you confirm the dialog (same with gtk3), so if for some reason the clipboard content changes or is cleared, that might be related.

Does copying somewhere else, e.g. to a text editor work after it failed in LO?

What's the output of `wl-paste --list` and `wl-paste --type=text/plain` at the following 2 points in time?

1) after you press Ctrl+Shift+V (i.e. before pasting)
2) after selecting to paste as plain text and seeing the error message in LO
Comment 23 Michael Weghorn 2024-04-30 05:06:29 UTC
@Stéphane:
I've now submitted 2 more related changes to master to address potential races Michael S. noticed in the review of the 24-2 backports of the previous ones.

I don't really expect they should be causing the issue you still describe, but maybe it's still worth retesting.

Commits:

    commit 8939999deef4f77f19d7b2d31df09260a34affe1
    Author: Michael Weghorn
    Date:   Fri Apr 26 14:39:14 2024 +0200

        qt: Avoid race on QtTransferable member

    commit 621cfc0e4120ab2b381b54268fe39bd19257df9b
    Author: Michael Weghorn
    Date:   Fri Apr 26 15:04:24 2024 +0200

        qt: Guard clipboard mime data with SolarMutex
Comment 24 Stéphane Guillou (stragu) 2024-04-30 06:23:35 UTC
(In reply to Michael Weghorn from comment #23)
> @Stéphane:
> I've now submitted 2 more related changes to master to address potential
> races Michael S. noticed in the review of the 24-2 backports of the previous
> ones.
The current daily build doesn't have those yet, so I can still reproduce.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f4ef5435df5560e6b6b061ce4053c71e2819bf51
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)

Will report back at the next build.

(In reply to Michael Weghorn from comment #21)
> Do you notice any relevant difference in what we're doing (e.g. different
> browser, different kind of text copied,...)?
> 
> Versions of potentially relevant packages (might e.g. also be related to Qt
> version etc.):
> 
> * firefox-esr    115.9.1esr-1~deb12u1
> * libqt5core5a:amd64 5.15.10+dfsg-7
> * libqt5waylandclient5:amd64 5.15.10-2+b1
> * kwin-wayland   4:5.27.10-1
I've got:
* firefox (snap)         125.0.2-1   (4173)
* libqt5core5a           5.15.3+dfsg-2ubuntu0.2
* libqt5waylandclient5   5.15.3-1
* kwin-wayland           not installed

Something obvious here?

I just tested on KDE Neon Testing, and could reproduce in 24.2.2 but not anymore in today's daily build, so that matches bug 156562.

--- Side note: ---

Maybe unrelated, but note that the copy button in LO's About dialog also behaves weirdly for me in kf5 (cairo+wayland): pasting works inside LO, but can't paste it outside. I can however: click the button, paste on canvas, then copy again from canvas, and then paste outside LO.
This is not reproduced on KDE Neon Testing at all.
Comment 25 Michael Weghorn 2024-04-30 06:42:52 UTC
(In reply to Stéphane Guillou (stragu) from comment #24)
> (In reply to Michael Weghorn from comment #23)
> > Versions of potentially relevant packages (might e.g. also be related to Qt
> > version etc.):
> > 
> > * firefox-esr    115.9.1esr-1~deb12u1
> > * libqt5core5a:amd64 5.15.10+dfsg-7
> > * libqt5waylandclient5:amd64 5.15.10-2+b1
> > * kwin-wayland   4:5.27.10-1
> I've got:
> * firefox (snap)         125.0.2-1   (4173)
> * libqt5core5a           5.15.3+dfsg-2ubuntu0.2
> * libqt5waylandclient5   5.15.3-1
> * kwin-wayland           not installed
> 
> Something obvious here?

The Qt version differs. AFAIU, in particular KDE people backported quite some things to 5.15, so it's well possible some relevant fix is in the newer Qt or KF (KDE Frameworks) version rather than LO.

> I just tested on KDE Neon Testing, and could reproduce in 24.2.2 but not
> anymore in today's daily build, so that matches bug 156562.

That would also make sense if the fix was in Qt/KF, as that has newer versions of those.
Comment 26 Michael Weghorn 2024-04-30 06:46:30 UTC
(In reply to Michael Weghorn from comment #25)
> The Qt version differs. AFAIU, in particular KDE people backported quite
> some things to 5.15, so it's well possible some relevant fix is in the newer
> Qt or KF (KDE Frameworks) version rather than LO.
To illustrate that a bit more, as that currently seems to be the most likely explanation to me: I kept trying Plasma Wayland on Debian testing every few months for probably about two years and always switched back to X11 until a few months ago, when I finally considered it quite ready for my regular daily use.