Created attachment 178500 [details] Demonstrating the clipboard pasting bug SUMMARY When using a clipboard action that changes the clipboard, it seemingly doesn't work until you repeat the action a 2nd time. STEPS TO REPRODUCE 1. Create a clipboard action and edit command, selecting either Replace current clipboard or Append to clipboard. 2. Copy the text you set it to recognize. 3. Execute the action. 4. Try to paste the new text. OBSERVED RESULT The correct text appears in the clipboard, but pasting it fails. Selecting the text in the clipboard history does not help. If you repeat the actions of selecting the text and running the action a 2nd time, you'll then be able to properly paste as expected. EXPECTED RESULT I expected to be able to paste the text loaded into the clipboard after running the action the first time, as in the previous version of Plasma. SOFTWARE/OS VERSIONS Operating System: EndeavourOS KDE Plasma Version: 6.3.0 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.2-zen1-1-zen (64-bit) Graphics Platform: X11 Please see attached video for a demonstration.
Created attachment 178501 [details] screenshot of the clipboard action I used in this testing video.
I just noticed that problem manifests in a different way: A script that I use to copy text to the clipboard using qdbus org.kde.klipper /klipper setClipboardContents sometext also triggers the same problem. The clipboard appears to be loaded but cannot paste until it's loaded a 2nd time.
I am able to reproduce this on Plasma 6.3.0 as well as git-master using the steps in the report and following the video Set up clipboard action Opened KWrite Started with empty clipboard 1. Typed into KWrite "this is a test" 2. Highlighted the phrase, right click, copy 3. Right clicked (or pressed Ctrl+Alt+R) to bring up the action menu 4. Clicked "test" and tried to paste
For what it's worth, pyqt6's QtWidgets.QApplication([False]).clipboard().setText() seems to work properly.
Can reproduce, will investigate
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5241
Git commit 30927e913945a36715d68c891ba09aa872b1df97 by Fushan Wen. Committed on 25/02/2025 at 02:38. Pushed by fusionfuture into branch 'master'. klipper: fix clipboard actions not setting clipboard for the first time HistoryModel::insert(QString) is for testing purpose only as the clip data needs some time to be saved, so the overload can't be used to set the clipboard. Let ClipCommandProcess manually manipulate the system clipboard and notify HistoryModel a new clip is available to update the history. FIXED-IN: 6.3.2 M +1 -1 CMakeLists.txt M +12 -14 appiumtests/applets/clipboardtest.py M +1 -1 klipper/CMakeLists.txt M +10 -3 klipper/clipcommandprocess.cpp M +2 -0 klipper/clipcommandprocess.h M +8 -5 klipper/klipper.cpp M +59 -55 klipper/systemclipboard.cpp M +6 -6 klipper/systemclipboard.h https://invent.kde.org/plasma/plasma-workspace/-/commit/30927e913945a36715d68c891ba09aa872b1df97
Git commit c8f84785e59d1cffdbd82b7bc4b448ee124d6c62 by Fushan Wen. Committed on 25/02/2025 at 03:09. Pushed by fusionfuture into branch 'Plasma/6.3'. klipper: fix clipboard actions not setting clipboard for the first time HistoryModel::insert(QString) is for testing purpose only as the clip data needs some time to be saved, so the overload can't be used to set the clipboard. Let ClipCommandProcess manually manipulate the system clipboard and notify HistoryModel a new clip is available to update the history. FIXED-IN: 6.3.2 (cherry picked from commit 30927e913945a36715d68c891ba09aa872b1df97) M +1 -1 CMakeLists.txt M +12 -14 appiumtests/applets/clipboardtest.py M +1 -1 klipper/CMakeLists.txt M +10 -3 klipper/clipcommandprocess.cpp M +2 -0 klipper/clipcommandprocess.h M +8 -5 klipper/klipper.cpp M +59 -55 klipper/systemclipboard.cpp M +6 -6 klipper/systemclipboard.h https://invent.kde.org/plasma/plasma-workspace/-/commit/c8f84785e59d1cffdbd82b7bc4b448ee124d6c62