SDL_SetWindowAlwaysOnTop(3)
β¨ SDL_SetWindowAlwaysOnTop β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_SetWindowAlwaysOnTop(3) π
πΈ NAME πΈ
SDL_SetWindowAlwaysOnTop β set the window to always be above the others. yes, your window gets VIP velvet rope energy and nobody can sit in front of it π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_video.h>
bool SDL_SetWindowAlwaysOnTop(SDL_Window *window, bool on_top);
π DESCRIPTION π
so here's the tea: this will add or remove the window's SDL_WINDOW_ALWAYS_ON_TOP flag. that's it, that's the whole job, and it does it flawlessly π«Ά
and it's not just a flag flip and dip β this will also bring the window to the front and keep the window above the rest. like, it literally walks your window to the front of the line and goes "she stays here, thanks" π
π FUNCTION PARAMETERS π
windowβ the window of which to change the always on top state. yeah, this one's the one getting the glow-up β¨on_topβtrueto set the window always on top,falseto disable. so like,true= queen behavior,false= she's coming back down to earth with the rest of us π
β RETURN VALUE β
Returns true on success or false on failure β and if it's a false girlie, call SDL_GetError() for more information. she will tell you what went wrong, fr fr π
π§ THREAD SAFETY π§
This function should only be called on the main thread. no side-quest threads for this one, bestie, it's a one-thread kind of situation π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something olderβ¦ yeah, you're not getting in the club, sorry π
π SEE ALSO π
SDL_GetWindowFlags(3)β go check the flags, iykyk
Simple Directmedia Layer β¦ SDL 3.4.18 β¦ SDL_SetWindowAlwaysOnTop(3)
and that's the whole page, no cap π stay iconic, keep your windows on top (only when you want to), and go read SDL_GetWindowFlags(3) next, mwah πΈπ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms