Defend against rogue clipboard managers
Hopefully the best of all worlds regarding the discussions on #5528 (closed):
Detect rapid chains of clipboard requests immediately after copying, and block them from accessing anything other than the svg/text/png targets.
This stops rogue clipboard managers from causing lag, while not blocking legitimate requests from the user, and also not blocking clipboard managers from saving the important targets to the clipboard history.
With plasma 6.3.4, the output with extra logging is
Allowed clipboard request: text/plain
Allowed clipboard request: text/plain
Allowed clipboard request: image/png
Allowed clipboard request: text/plain
Allowed clipboard request: text/plain
Allowed clipboard request: image/png
Denied clipboard request: text/xml+fxg, time interval 0 ms
Denied clipboard request: text/html, time interval 0 ms
Denied clipboard request: text/x-tex, time interval 0 ms
Denied clipboard request: text/xml+xaml, time interval 0 ms
Denied clipboard request: text/x-povray-script, time interval 0 ms
(Note: KDE need to fix the duplicate requests - reported.)
I think this would be pretty safe to backport, so adding backportproposed for now until proven otherwise.
Fixes #5528 (closed) - although the issue has really been going on for 17 years.
Edited by PBS