The active window does already have access to the clipboard’s current data.
Essentially clicking on a different entry makes that the current one which the application can then manually paste even under normal circtumstances.
This has been a requested feature for quite some time but it will mostly depend on how this is implemented.
Some of the discussions I have seen on this topic indicate several hackish ways to do it and very few proper solutions.
You could find the feature request for this on bugs.kde.org and post the link to your repo