SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR(3)

✨ SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR ✨

okay bestie, this is a page from the SDL3 FUNCTIONS manual, and it's all about one little hint that decides who gets to draw your window decorations on Wayland. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR β€” a variable that controls whether the libdecor Wayland backend gets preferred over native decorations.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"

πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is: when this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is available. and before you come for me β€” note that, by default, libdecor will use xdg-decoration itself if it's available. so it's giving layers on layers, iykyk 😭

the variable can be set to these values:

  • "0" β€” libdecor is enabled only if server-side decorations are unavailable. (this is the default, bestie πŸ‘‘)
  • "1" β€” libdecor is always enabled if available. periodt.
πŸ’– heads up: this hint should be set before SDL is initialized. like, before. don't be late to the party fr fr.

🌈 AVAILABILITY 🌈

this hint has been available since SDL 3.2.0. iconic behavior, honestly.


and that's the whole page, bestie 🫢 go forth and decorate your windows with main character energy πŸ’œ

🧚 source: Simple Directmedia Layer, version SDL 3.4.18. mwah, slay, bye πŸ’…βœ¨
πŸ“¦ where this page comes from