al_x_set_initial_icon(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_x_set_initial_icon ✨

okay bestie, welcome to the Allegro 5 API corner of the internet πŸŽ€ this one's a lil function called al_x_set_initial_icon, and she's here to fix your window icon drama. let's get into it πŸ’…


🌸 NAME 🌸

al_x_set_initial_icon β€” the Allegro 5 API, but make it ✨icon✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro_x.h>

bool al_x_set_initial_icon(ALLEGRO_BITMAP *bitmap)

πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie β˜• on some window managers β€” and notably Ubuntu's Unity is the main character here β€” al_set_display_icon literally just does not work 😭 and the workaround is that you have to use a .desktop file. which is fine but also, like, annoying.

BUT. with this function you can set an icon before calling al_create_display 🫢 and it actually works, because the way it does this is by setting the icon before XMapWindow happens. no cap, that's the whole trick. iconic behaviour fr fr πŸ‘‘


⭐ SINCE ⭐

5.2.3 β€” so she's been around a minute πŸ’œ

[Unstable API]: New API. ⚠️ heads up bestie, this one's flagged unstable β€” tread accordingly πŸ™ˆ

and that's the whole vibe check, babe ✨ this page came to you straight from the Allegro reference manual (al_x_set_initial_icon(3alleg5)) β€” go forth and icon-ify your windows, you absolute legend πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from