Skip to content
Myr

xdg: load_icon: fallback to searching /usr/share/pixmaps

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When we fail to find an icon in the icon theme, fall back to searching <xdg-data-dirs>/pixmaps (e.g. /usr/share/pixmaps).

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 6b08b2f · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:xdg.c+15 added
90 unmodified lines
91 }92 }93 }9495 xdg_data_dirs_t dirs = xdg_data_dirs();96 tll_foreach(dirs, it) {97 char path[strlen(it->item) + 1 +98 strlen("pixmaps") + 1 +99 strlen(name) + strlen(".png") + 1];100 sprintf(path, "%s/pixmaps/%s.png", it->item, name);101102 cairo_surface_t *surf = cairo_image_surface_create_from_png(path);103 if (cairo_surface_status(surf) == CAIRO_STATUS_SUCCESS) {104 xdg_data_dirs_destroy(dirs);105 return surf;106 }107 }108 xdg_data_dirs_destroy(dirs);109110 return NULL;111}112113static void
238 unmodified lines