Bug 493832

Summary: Picking a screen color fails to copy it to the clipboard when it was already in the clipboard, but with something else as the first clipboard entry
Product: [Plasma] plasmashell Reporter: Kath <krazykath>
Component: Color Picker widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: kde, krazykath, nate, qydwhotmail
Priority: NOR    
Version First Reported In: 6.2.3   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Video showing color picker clipboard bug
Video of colour picker clipboard not updating

Description Kath 2024-09-29 13:12:29 UTC
SUMMARY
ColorPicker applet does not copy colour code to clipboard is if a program is in focus

STEPS TO REPRODUCE
1. Have "Automatically copy colour to clipboard" selected in Color Picker settings
2. Have another program in focus (For example: KWrite)
3. Pick a colour from anywhere on screen

OBSERVED RESULT
The colour is picked, but the colour code is not copied to clipboard

EXPECTED RESULT
The colour code is copied to clipboard

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
If you focus the desktop - clicking the background image - colour copying works correctly. This only happens when another program is in focus

Focusing the Task manager does not work. Other programs that also do not work include KWrite, Dolphin, GIMP, Firefox, Neochat.
Comment 1 Nate Graham 2024-09-30 19:36:25 UTC
Cannot reproduce with current git master. Can you attach a screen recording that shows the issue happening? Thanks a lot@
Comment 2 Kath 2024-09-30 19:59:55 UTC
Created attachment 174242 [details]
Video showing color picker clipboard bug

Bug shown in video, with example of using KWrite where copying to clipboard does not work when focused
Comment 3 Nate Graham 2024-10-11 20:04:47 UTC
Thanks. Unfortunately I still cannot reproduce the issue with those exact steps. Do you have a non-default window focus mode set, perhaps? Does the issue reproduce in a new clean user account with the color picker on your panel being the only customization?
Comment 4 Kath 2024-10-11 21:18:57 UTC
Created attachment 174715 [details]
Video of colour picker clipboard not updating

After some more testing, I have a reliable way to reproduce this.

Picking the same colour twice in a row does not copy it to the clipboard a second time. However this logic doesn't seem to be aware of other changes to the clipboard. 

So if I pick a colour, copy some text, then pick the same colour again, it will not copy the colour the second time, despite the colour no longer being at the top of the clipboard history.
This is also the case if I pick a colour, delete its clipboard entry and then pick it again.

See attached video.

Since opening this bug I have updated my system. New software information below

Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.12-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
Comment 5 Nate Graham 2024-10-16 17:37:50 UTC
Interesting. I still can't reproduce that: if I pick a color, then a different color, and then the first color again, the clipboard entry for that color becomes the top one in the Clipboard widget, just like I would expect.

Fushan, do you have any ideas regarding what might be going on here?
Comment 6 Kath 2024-10-16 17:49:02 UTC
(In reply to Nate Graham from comment #5)
> Interesting. I still can't reproduce that: if I pick a color, then a
> different color, and then the first color again, the clipboard entry for
> that color becomes the top one in the Clipboard widget, just like I would
> expect.

Just to be clear you must copy something else unrelated in between the same colour picking - apologies if I wasn't clear before

Steps
1. Pick colour A
2. Copy something unrelated (eg "text")
3. Pick colour A

Observed
Colour code is not moved to the top of the clipboard widget. The previous copied text is still the latest entry

Expected
Colour A is moved to be the latest in the clipboard history

This only occurs if its the same colour picked. Picking a different colour will work as intended and become the latest clipboard entry
Comment 7 Bug Janitor Service 2024-10-31 03:46:55 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Nate Graham 2024-10-31 15:11:46 UTC
Thanks. I can reproduce that.