ksystemclipboard: Dispatch read events in another thread
WaylandClipboard wraps ext_data_control if an application tried to read the clipboard using QClipboard whilst it owns the data control we would deadlock.
This was previously being solved by trying to transfer mimedata to the regular clipboard upon gaining focus. However this never worked reliably and efforts to fix this only made it more complicated.
To solve the original deadlock all ext_data_control classes now live on another thread which dispatches events on a separate queue. A recursive mutex allows the main thread to read mimedata and no wayland events which change the mimedata process until this is complete.
BUG: 480448 BUG: 496029 BUG: 502831 BUG: 505281 BUG: 506467 BUG: 507792 BUG: 509065 BUG: 509689 BUG: 511736 FIXED-IN: 6.22
Co-authored-by: David Redondo kde@david-redondo.de