Bug 432819 - "Prevent empty clipboard" always enforced on X11 even if unchecked
Summary: "Prevent empty clipboard" always enforced on X11 even if unchecked
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (other bugs)
Version First Reported In: 5.20.5
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 434419 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-11 22:43 UTC by MomKingHacker
Modified: 2023-08-14 21:26 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MomKingHacker 2021-02-11 22:43:33 UTC
SUMMARY

I had an issue when an empty record would be randomly added to clipboard which can be seen by the widget in tray, googled about it, found out that you need to check "prevent empty clipboard" checkbox in the settings of the widget, but it was already checked, so after suffering for some time I thought that the checkbox could be mistakenly inverted, so I unchecked it and the issue seems to be fixed(at least I haven't had any troubles with it so far). So, I think you need to either rename it to "Allow empty clipboard" or invert the value, because now it doesn't make sense. 


OBSERVED RESULT

checkbox doesn't work as expected

EXPECTED RESULT

checkbox works as expected


SOFTWARE/OS VERSIONS
OS: KDE neon 5.20
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-02-12 18:14:12 UTC
What was causing that issue with an empty record being added to the clipboard? Which app was causing it?
Comment 2 MomKingHacker 2021-02-14 11:43:41 UTC
(In reply to Nate Graham from comment #1)
> What was causing that issue with an empty record being added to the
> clipboard? Which app was causing it?

Firefox
Comment 3 Nate Graham 2021-02-16 16:06:32 UTC
Thanks. So some webpage was randomly adding an empty string to the clipboard? Were you able to verify which website it was? Is it reproducible?
Comment 4 MomKingHacker 2021-02-16 21:30:54 UTC
(In reply to Nate Graham from comment #3)
> Thanks. So some webpage was randomly adding an empty string to the
> clipboard? Were you able to verify which website it was? Is it reproducible?

I don't remember where, but it was happening on multiple sites. Can't reproduce it now, maybe it was related to using Wayland where Firefox probably was running inside XWayland. Can't reproduce it either, because after the latest update Wayland is totally broken(hotkeys don't work and Firefox doesn't start)
Comment 5 Nate Graham 2021-02-19 16:01:54 UTC
Hmm, if you can't reproduce the issue, I'm not sure there's anything we can do here. :/ Sorry. Let us know if you find a reproducible test case.
Comment 6 MomKingHacker 2021-02-19 22:37:47 UTC
(In reply to Nate Graham from comment #5)
> Hmm, if you can't reproduce the issue, I'm not sure there's anything we can
> do here. :/ Sorry. Let us know if you find a reproducible test case.

But the ticket is not about that, it's about the checkbox "prevent empty clipboard" doing exactly opposite of what it says.
Comment 7 Nate Graham 2021-02-19 22:59:15 UTC
The reason why I'm trying to get to the bottom of the thing causing it from Firefox is because I can't reproduce the issue as you described it, so I'm trying to see what could be causing the symptoms you're seeing.
Comment 8 MomKingHacker 2021-02-20 09:59:58 UTC
(In reply to Nate Graham from comment #7)
> The reason why I'm trying to get to the bottom of the thing causing it from
> Firefox is because I can't reproduce the issue as you described it, so I'm
> trying to see what could be causing the symptoms you're seeing.

You can use any software that is able to put empty record to the clipboard. Like this script https://jsfiddle.net/cndbyx6u/ Btw, with this example "Prevent empty clipboard" doesn't work at all, any state of the checkbox lead to the empty record being added. 

KDE Plasma Version: 5.21.0
Klipper Version: 5.21.0
Comment 9 Nate Graham 2021-02-25 04:19:24 UTC
Thanks.
Comment 10 Nate Graham 2021-03-21 04:18:03 UTC
Cannot reproduce FWIW.
Comment 11 Nate Graham 2021-03-21 04:18:09 UTC
*** Bug 434419 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2021-03-21 04:19:35 UTC
This setting is clearly buggy on X11. For me, I have the opposite problem as you and the fellow in the duplicate report: the "Prevent empty clipboard" setting does nothing even if checked.

It works properly for me in the Plasma Wayland session.
Comment 13 Sudhir Khanger 2021-03-21 05:08:02 UTC
1. Why is an empty text value added at all to the clipboard? Where would you paste "" or ''? If you can't paste it anywhere why does clipboard allow it to be added to its entries.

>Prevent empty clipboard

2. This is a very weird feature. First of all as far as I can tell its purpose is to readd most recently added entry to the clipboard manager if you happen to clear all entries. It doesn't look like it has anything to do with adding an empty entry. You are explicitly deleting all entries but you want to preserve the most recent entry sounds like a very special case to me. I have 1000s of entries in the clipboard manager which I have built as a productivity tool over the years. It's like deleting your browser history.

In my case, I don't see any difference with or without the aforementioned option. I am not sure if that's the only line we should think out in especially when we aren't talking about an empty clipboard.
Comment 14 Nate Graham 2021-03-21 11:34:24 UTC
Let's not pass judgment on whether this feature is useful or not. :) The point is, it seems to be broken on X11.
Comment 15 Noah Davis 2023-08-11 20:18:21 UTC
It seems that the checkbox for setting this option was removed in commit 99d0f172e4aa0e69ba55870493deac4963e0b239 of plasma-workspace. Does that count as fixing this bug?
Comment 16 Nate Graham 2023-08-14 21:26:30 UTC
Pretty much, yeah.