SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED(3)

✨ NAME ✨

SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED β€” bestie, this is the hint that decides whether your window gets activated (aka pulled into the spotlight, main character mode πŸ‘‘) when someone calls the SDL_RaiseWindow function.

It's a variable, it's a vibe check for your window focus, and it lives in SDL3's hints header. Periodt.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED"

Yep, that's the whole incantation. One #include, one #define, and the string you'll be passing around is literally "SDL_WINDOW_ACTIVATE_WHEN_RAISED" πŸ’…


πŸ’– DESCRIPTION πŸ’–

So here's the tea β˜• β€” you can set this variable to one of these two values:

  • "0" β€” the window is not activated when the SDL_RaiseWindow function is called. It gets raised, sure, but it does not get activated. It's giving "I'm here but I'm not here here" πŸ™ˆ
  • "1" β€” the window is activated when the SDL_RaiseWindow function is called. (default) ⭐ This is the factory setting, the out-of-the-box behavior, the moment of slay.
🫢 Not me reminding you that this hint can be set anytime. Like, whenever. No timing restrictions, no "only before init" nonsense. You're free. Go off.

🌈 AVAILABILITY 🌈

This hint has been available since SDL 3.2.0. So if you're on anything older, sorry bestie, it's not there yet 😭


and that's the whole page, fr fr β€” no cap, you now know exactly how to control whether raising a window also activates it πŸ’–βœ¨

This little legend comes to you from Simple Directmedia Layer, page SDL 3.4.18, filed under SDL_HINT_WIND...E_WHEN_RAISED(3). Stay iconic, go raise some windows πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from