kwin and Gnome's solutions aren't reusable on other compositors. Gnome is awful at making their stuff reusable. KDE is much better, but their clipboard stuff isn't reusable, and Sway's likely won't be either due to the nature of the problem. There are plans to collaborate more with KDE on reusing KDE components in Sway and other compositors, which both parties are excited about.