Picking colour from desktop on Wayland
-
So, I have this system-wide colour picker software written in Qt using PySide6 and it works just fine on X11 systems. You can look at the implementation here.
But, to get this working on Wayland, I had to use the Freedesktop D-Bus implementation which waits for a response and blocks my entire flow. It seems to be made for the usecases where you only call it once but my usecase is of basically running it at the rate of the paintEvent because I need to pick it whenever the mouse moves or the screen updates (look at the GIF in the README.md).
This is how far I've gotten in the Wayland implementation but I need some help in being able to have it be seamless.
Maybe I should use QThread and workers which have a method to return the latest colour? But the FreeDesktop APIs explicitly wait for user input, it also messes up how my app is supposed to look like. I am reaching the limits of the sparse knowledge I have on this stuff so I need a nudge in the right direction.