magnum
magnum copied to clipboard
WindowFlag::AlwaysOnTop has no effect on Windows
First off, thanks for the framework and all the huge work developing & supporting it!
I'm just starting exploring Magnum, and I've noticed that on Windows, adding the ...WindowFlag::AlwaysOnTop
to the Configuration
passed to the SDL2Application
constructor has no effect, while executing SDL_SetWindowAlwaysOnTop (window(), SDL_TRUE)
when SDL2Application
has already been constructed does work as intended.
Reading the docs, I see the notice that the AlwaysOnTop
flag only works on X11.
So is my latter lower-level way the correct and recommended one for Windows?
Windows 10 21H1 and Magnum built as static lib from commit 781c5c3e088164027b001aedba46dfb7c92126db
, fwiw.
Hi, thanks for the thanks! :)
Adding a way to set (and unset, which is also important) a window to be always on top during runtime and not just on application startup is on my TODO list (https://github.com/mosra/magnum/issues/453), so eventually there will be a builtin API for that. Until then, using SDL APIs directly is a completely fine (and encouraged) thing to do, yes.
If I remember correctly, I exposed AlwaysOnTop
unconditionally on all platforms because I expected it to get gradually implemented for Windows, macOS and Wayland in newer versions of SDL, but I should probably rethink that decision -- because right now it just looks like a bug, a flag not doing what it should be doing. So going forward I'll probably expose it only on Linux and hide on other platforms, or I'll work around the SDL limitation by directly calling SDL_SetWindowAlwaysOnTop()
myself.
I'm not sure when I will get to implementing this tho, will keep the issue open until I do.