Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowFlag::AlwaysOnTop has no effect on Windows #536

Open
mitsukuri opened this issue Oct 1, 2021 · 1 comment
Open

WindowFlag::AlwaysOnTop has no effect on Windows #536

mitsukuri opened this issue Oct 1, 2021 · 1 comment
Projects
Milestone

Comments

@mitsukuri
Copy link

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.

@mosra mosra added this to the 2021.0a milestone Oct 2, 2021
@mosra mosra added this to TODO in Platforms via automation Oct 2, 2021
@mosra
Copy link
Owner

mosra commented Oct 2, 2021

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 (#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Platforms
  
TODO
Development

No branches or pull requests

2 participants