SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME(3)
π SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME(3) π
okay bestie, this is a page from the SDL3 FUNCTIONS manual β yes, that SDL3 β and we're talking about a hint. A hint!! Like when your friend hints that they want boba. Except this one tells your operating system why it should stop trying to put your screen to sleep. ππ€
β¨ NAME β¨
SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME β specify an "activity name" for screensaver inhibition. that's it, that's the whole job, and honestly? iconic. π
π SYNOPSIS π
#include <SDL3/SDL_hints.h>
#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
so you pull in the header and then the macro literally just expands to its own name as a string. lowkey self-referential queen behavior. π
π¦ DESCRIPTION π¦
okay so here's the vibe: some platforms β notably Linux desktops β keep a whole list of the applications that are currently inhibiting the screensaver or other power-saving features. like a little guest list, but for apps that are refusing to let the monitor nap. π
This hint is how you get your name on that guest list in a way that's actually descriptive. It lets you specify the "activity name" that gets sent to the OS when SDL_DisableScreenSaver() is used β or when the screensaver gets automatically disabled. The contents of this hint are what's used when the screensaver is disabled, so you should use a string that describes what your program is doing β and therefore why the screensaver is off. for example:
"Playing a game""Watching a video"
see? it's giving transparency. the OS deserves to know. π«Ά
Setting this to "" or leaving it unset will have SDL use a reasonable default: "Playing a game" or something similar. so like, if you can't be bothered, SDL has your back and picks for you. no cap. β¨
π timing matters!! This hint should be set before calling SDL_DisableScreenSaver(). set it early, bestie, or it's not gonna land the way you want. π
β AVAILABILITY β
This hint is available since SDL 3.2.0. so if you're on an older SDL, this is not the moment. π°οΈ
π SEE ALSO π
nothing else listed here, just you and this one glorious hint. iykyk. π§
and that's the whole page!! brought to you by Simple Directmedia Layer, SDL 3.4.18 edition β go forth and tell your OS what you're doing, main character. ππΈππ¦β¨
π¦ 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