fix theme service tests

This commit is contained in:
2026-09-13 15:34:56 -06:00
parent d2b8fc0bda
commit ff4217c3d1

View File

@@ -858,8 +858,10 @@ path_depth_from_root (const char *base, const char *path)
static gint static gint
theme_root_candidate_compare (gconstpointer a, gconstpointer b) theme_root_candidate_compare (gconstpointer a, gconstpointer b)
{ {
const ThemeRootCandidate *ca = a; /* g_ptr_array_sort() passes pointers to the array slots, not the values
const ThemeRootCandidate *cb = b; * stored in those slots. Dereference once before comparing candidates. */
const ThemeRootCandidate *ca = *(ThemeRootCandidate * const *) a;
const ThemeRootCandidate *cb = *(ThemeRootCandidate * const *) b;
if (ca->has_index_theme != cb->has_index_theme) if (ca->has_index_theme != cb->has_index_theme)
return ca->has_index_theme ? -1 : 1; return ca->has_index_theme ? -1 : 1;
if (ca->depth != cb->depth) if (ca->depth != cb->depth)