Blame SOURCES/0001-st-icon-Only-get-resource-scale-after-peeking-theme-.patch

553d37
From 187b851530f5e76786784ec9df235304c8ddede8 Mon Sep 17 00:00:00 2001
553d37
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
553d37
Date: Wed, 4 Aug 2021 19:46:34 +0200
553d37
Subject: [PATCH] st/icon: Only get resource-scale after peeking theme node
553d37
553d37
If an actor is not on any stage view, then it doesn't have a valid
553d37
resource scale, which will hit an assert later.
553d37
553d37
When that is the case (for example when running headless), we expect
553d37
that there is no valid theme node (yet) either, so simply moving
553d37
the clutter_actor_get_resource_scale() call after peeking at the
553d37
theme node is enough to avoid the crash.
553d37
553d37
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4522
553d37
553d37
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1935>
553d37
---
553d37
 src/st/st-icon.c | 2 ++
553d37
 1 file changed, 2 insertions(+)
553d37
553d37
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
553d37
index 0405d85259..e4d6e05f94 100644
553d37
--- a/src/st/st-icon.c
553d37
+++ b/src/st/st-icon.c
553d37
@@ -462,6 +462,8 @@ st_icon_update (StIcon *icon)
553d37
 
553d37
   resource_scale = clutter_actor_get_resource_scale (CLUTTER_ACTOR (icon));
553d37
 
553d37
+  resource_scale = clutter_actor_get_resource_scale (CLUTTER_ACTOR (icon));
553d37
+
553d37
   stage = clutter_actor_get_stage (CLUTTER_ACTOR (icon));
553d37
   context = st_theme_context_get_for_stage (CLUTTER_STAGE (stage));
553d37
   g_object_get (context, "scale-factor", &paint_scale, NULL);
553d37
-- 
553d37
2.31.1
553d37