Windows with Qt:Tool flag shown on all desktops on Windows OS
-
-
Tool windows have a
WS_EX_TOOLWINDOWstyle flag set, so the window manager styles them appropriately. This flag is also what causes this behavior and a lot of apps (not just Qt based) experience this. It doesn't seem to be documented anywhere on Microsoft's sites though, so it's hard to say if it's a bug or a feature.So whether that's intentional or not that's just how tool windows behave on virtual desktops. The only way to prevent this I know is to remove that style flag. You can do that with native SetWindowLong to set
GWL_EXSTYLE, but that's basically the same as just not using theQt::Toolflag and will make your window not look/behave like a tool window. -
Tool windows have a
WS_EX_TOOLWINDOWstyle flag set, so the window manager styles them appropriately. This flag is also what causes this behavior and a lot of apps (not just Qt based) experience this. It doesn't seem to be documented anywhere on Microsoft's sites though, so it's hard to say if it's a bug or a feature.So whether that's intentional or not that's just how tool windows behave on virtual desktops. The only way to prevent this I know is to remove that style flag. You can do that with native SetWindowLong to set
GWL_EXSTYLE, but that's basically the same as just not using theQt::Toolflag and will make your window not look/behave like a tool window.@Chris-Kawa Thanks for the info. Since the windows that have the flag set in my application need to have it, users will have to learn to live with it.
-
@Chris-Kawa Thanks for the info. Since the windows that have the flag set in my application need to have it, users will have to learn to live with it.
@gvanvoor Yeah, unfortunately it's a Windows API behavior, so you'd have to ask someone from Microsoft if that's intended and if there's a workaround.
Maybe you can fiddle with the virtual desktop manager API, but I haven't tried it so can't give you specifics.