Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep a application window always on current desktop on linux and mac

I search a way to put a QWidget window of a Qt application always on the current desktop/workspace. When I change the virtual desktop, I need my window to be automatically visible on the new current virtual desktop.

I search a solution that works at minimum on gnome, kde on linux and mac os.

I think the first step is to detect when virtual desktop is change, I don't know if Qt have a API for that or if I need to implement it for each desktop solution.

like image 456
Julien DAUPHANT Avatar asked Oct 20 '25 01:10

Julien DAUPHANT


1 Answers

Under X11, you are supposed to set the _NET_WM_DESKTOP window property to 0xFFFFFFFF. I suspect there's no Qt API for that, so you'll have to litter the code with #ifdefs checking for X11 and call an appropriate X's function (nope, I don't know which one it is).

like image 56
Jan Kundrát Avatar answered Oct 21 '25 15:10

Jan Kundrát



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!