Bug 455039

Summary: Clipboard content cannot be pasted if the application of the content is closed before pasting
Product: [Plasma] plasmashell Reporter: Dean <programmer.pesesoft+kde>
Component: Clipboard widget & pop-upAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate
Priority: NOR    
Version: 5.24.5   
Target Milestone: 1.0   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dean 2022-06-08 16:17:06 UTC
SUMMARY
The clipboard content, be it Text or Image (should also happen to file reference like copying a file from Dolphin), cannot be pasted if the application where the content comes from (be it from Copy or Cut) is closed, even if the content is listed on the popup menu.

It however can still be pasted if we open the popup (Open Klipper at Mouse Position) and select the content, then paste.

STEPS TO REPRODUCE
# Text
1. Open KWrite
2. Open Kate
3. Write something, for example, "Hello World" into either KWrite or Kate, let's use Kate for simplicity
4. Select all the text and either Copy or Cut
5. Close Kate, if asked, discard/don't save the content
6. Go to/focus on KWrite
7. Try to paste the content (Right Click Paste or CTRL + V)

# Image
1. Take a screenshot using spectacle, either by opening the app or through a keyboard shortcut
2. If opening the app or the shortcut is opening the spectacle dialog, save the content to the clipboard and close the spectacle
3. Try to paste the content to GIMP, Discord, Krita, or any program that accepts an image

OBSERVED RESULT
Nothing is being pasted, either by Context menu or Keyboard Shortcut, it can still be pasted by opening Klipper at the cursor position, selecting the first entry (which is the previously copied/cut content) and then trying to paste again either using Context Menu or Keyboard Shortcut


EXPECTED RESULT
The content should be still being pasted regardless if the source application is closed or not

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: Manjaro KDE
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
This is the recording of the bug https://streamable.com/tz5p9w
Comment 1 Nate Graham 2022-06-08 19:10:16 UTC
Have you set your clipboard history to be "0" or disabled the "Clipboard" System Tray applet?
Comment 2 Dean 2022-06-08 19:58:18 UTC
(In reply to Nate Graham from comment #1)
> Have you set your clipboard history to be "0" or disabled the "Clipboard"
> System Tray applet?

I don't know where to "Disable Clipboard" but my Clipboard History is set to 20 (I think it is the default)
Comment 3 Dean 2022-06-08 20:00:21 UTC
(In reply to Dean from comment #2)
> (In reply to Nate Graham from comment #1)
> > Have you set your clipboard history to be "0" or disabled the "Clipboard"
> > System Tray applet?
> 
> I don't know where to "Disable Clipboard" but my Clipboard History is set to
> 20 (I think it is the default)

If what you meant is the System Tray Settings -> Entries -> Clipboard, then no, I set it to Always Shown
Comment 4 Dean 2022-06-08 20:28:21 UTC
(In reply to Dean from comment #3)
> (In reply to Dean from comment #2)
> > (In reply to Nate Graham from comment #1)
> > > Have you set your clipboard history to be "0" or disabled the "Clipboard"
> > > System Tray applet?
> > 
> > I don't know where to "Disable Clipboard" but my Clipboard History is set to
> > 20 (I think it is the default)
> 
> If what you meant is the System Tray Settings -> Entries -> Clipboard, then
> no, I set it to Always Shown

I think I found the cause, so the System Tray applet is added to Latte Dock Panel, and since I'm curious tried to disable every shortcut from Klipper on this system tray, and then add a new default plasma panel (not Latte Dock) and add System Tray applet there and set up the shortcut key for the Klipper, while the Latte Dock panel still have the System Tray applet, it still happened, the content can't be pasted. And then I remove the whole System Tray applet from the Latte Dock, and now it is working as it should be.

So I think the bug is related to Latte Dock, should I re-report this to Latte Dock?
Comment 5 Nate Graham 2022-06-09 15:38:35 UTC
I think the issue is more general. It's Bug 442925.

This is one of those cases where "just because you can, doesn't mean you should." :) We give you a lot of customizability but it's up to you to avoid braking your system if you use it. We probably need to be better about putting guardrails around these things.

*** This bug has been marked as a duplicate of bug 442925 ***
Comment 6 Nate Graham 2023-04-27 23:20:27 UTC

*** This bug has been marked as a duplicate of bug 423625 ***