Bug 502886 - Clipboard content not registered on first navigator.clipboard.writeText() call from browsers in Plasma 6.3.4 (X11)
Summary: Clipboard content not registered on first navigator.clipboard.writeText() cal...
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (other bugs)
Version First Reported In: 6.3.4
Platform: Manjaro Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: X11-only
Depends on:
Blocks:
 
Reported: 2025-04-16 15:50 UTC by luke60
Modified: 2025-11-22 03:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description luke60 2025-04-16 15:50:05 UTC
Since upgrading to KDE Plasma 6.3.4 (under X11), I noticed that clipboard operations initiated by websites using `navigator.clipboard.writeText()` do not register on the first attempt.

Tested on ChatGPT and other websites using copy buttons. When clicking a "copy" button (such as one used to copy a code block), nothing is copied the first time. Pasting (Ctrl+V) returns nothing. However, clicking the same button a second time works — the clipboard content is now correct and pastes as expected.

This issue is consistent across browsers and unaffected by clipboard manager:

Steps to reproduce:
1. Open ChatGPT (or any site with JavaScript-based "copy" button)
2. Click once on a copy button (e.g., copy code block)
3. Try to paste → nothing is pasted
4. Click the same copy button a second time
5. Paste → the content appears correctly

Observed behavior:
- The clipboard history (tested with both Klipper and CopyQ) does not record anything on the first attempt
- Manual Ctrl+C works fine
- navigator.clipboard.writeText() is successful on second attempt
- CopyQ and Klipper both fail to register the first copy action
- Occurs under both Firefox and Brave
- Happens with a fresh user config and after recreating panels/widgets

Environment:
- KDE Plasma version: 6.3.4
- KDE Frameworks version: 5.116.0
- Qt version: 5.15.16
- Distribution: Manjaro Linux
- Session type: X11
- Clipboard managers tested: Klipper, CopyQ
- Browsers tested: Firefox, Brave

Expected result:
Clipboard content written by navigator.clipboard.writeText() should be usable immediately, even on the first attempt.

Actual result:
Nothing is copied on first attempt; only the second call works.

This appears to be a regression in Plasma 6.3.4 or related clipboard handling via X11.

Thank you!
Comment 1 Fushan Wen 2025-04-17 02:11:28 UTC
Tested in https://www.w3schools.com/howto/howto_js_copy_clipboard.asp, but cannot reproduce with Klipper and Firefox