Thank you for your answer!

I've tried the QX11Info::appRootWindow. I might not have understood how it works because I get a segmentation fault when I create a QWidget with the returned handle. Maybe the handle is the desktops one? Or maybe I just can't create a widget with that handle?