SDL_HINT_APP_ID(3)

πŸ’– SDL_HINT_APP_ID πŸ’–

okay bestie, gather round, because this one is lowkey the glow-up your app's identity has been waiting for. this is SDL_HINT_APP_ID, a page from the SDL3 FUNCTIONS manual, and it's about exactly one thing: the app ID string. that's it. that's the whole vibe. ✨


🌸 NAME 🌸

SDL_HINT_APP_ID β€” a variable setting the app ID string. no cap, that's the whole job description. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_APP_ID "SDL_APP_ID"

there she is. one include, one define, zero drama. πŸ¦‹


✨ DESCRIPTION ✨

so here's the tea, bestie: this string is what desktop compositors use to identify and group windows together. like, it's how your compositor knows that these windows are all part of this app, and not some random little strays wandering the desktop. main character energy, fr fr. πŸ‘‘

and it doesn't stop there β€” it also matches applications with their associated desktop settings and icons. so your app gets to wear its own outfit instead of being handed whatever generic fit the system had lying around. iconic. πŸŽ€

also important: this will override SDL_PROP_APP_METADATA_IDENTIFIER_STRING, if that one was set by the application. so if you set both, this hint wins. periodt. πŸ’…

timing check!! this hint should be set before SDL is initialized. set it late and it's giving "oops, missed the window" (literally). don't do that to yourself. 😭

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. if you're on anything older, bestie, it's not you, it's the version. πŸ™ˆ


and that's the whole page!! sending you off with the source deets: this came from the Simple Directmedia Layer manual, SDL 3.4.18, filed under SDL_HINT_APP_ID(3). go set that app ID before init and slay. πŸ«ΆπŸ’–πŸ§š

πŸ“¦ where this page comes from