From 383f25dbe152b0aaa6f8be6339626fd9088de288 Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Wed, 23 Aug 2023 23:18:50 +0200 Subject: [PATCH] SNI: Fix pixmap g_variant_iter_n_children apparently returns 1 instead of 3 (array = child, but I don't know). I inverted the statement, because for empty property, it hasn't any children. --- src/SNI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SNI.cpp b/src/SNI.cpp index 70b68f6..f9d55cc 100644 --- a/src/SNI.cpp +++ b/src/SNI.cpp @@ -90,7 +90,7 @@ namespace SNI GVariantIter* arrIter = nullptr; g_variant_get(arr, "a(iiay)", &arrIter); - if (g_variant_iter_n_children(arrIter) == 3) + if (g_variant_iter_n_children(arrIter) != 0) { int width; int height; @@ -125,10 +125,10 @@ namespace SNI } g_variant_iter_free(data); - g_variant_iter_free(arrIter); hasPixmap = true; } + g_variant_iter_free(arrIter); g_variant_unref(arr); g_variant_unref(iconPixmap); }