From ff4217c3d1eb1e322506e8a372681a7e980a26f4 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 13 Sep 2026 15:34:56 -0600 Subject: [PATCH] fix theme service tests --- src/common/gtk3-theme-service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/gtk3-theme-service.c b/src/common/gtk3-theme-service.c index a39fc418..56d068d3 100644 --- a/src/common/gtk3-theme-service.c +++ b/src/common/gtk3-theme-service.c @@ -858,8 +858,10 @@ path_depth_from_root (const char *base, const char *path) static gint theme_root_candidate_compare (gconstpointer a, gconstpointer b) { - const ThemeRootCandidate *ca = a; - const ThemeRootCandidate *cb = b; + /* g_ptr_array_sort() passes pointers to the array slots, not the values + * 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) return ca->has_index_theme ? -1 : 1; if (ca->depth != cb->depth)