[gnome-shell/gnome-3-38] st/texture-cache: Fail loading invalid StImageContent
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-38] st/texture-cache: Fail loading invalid StImageContent
- Date: Mon, 15 Mar 2021 19:43:48 +0000 (UTC)
commit f436c275474b1b9dda35eed71ac07150ca1e88cf
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Mar 12 23:25:12 2021 +0100
st/texture-cache: Fail loading invalid StImageContent
Creating a content object from a cairo surface may fail, in which case
we return an empty content with a 0x0 preferred size.
However when we treat such a content object as GIcon, we happily load
it anyway. Don't do that, so consumers like StIcon can fall back properly
to an alternative.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1761>
(cherry picked from commit 565255068874e004a5c0b8b98396591ec89a91d2)
src/st/st-texture-cache.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b20ad7cc50..c6dde1c425 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -983,6 +983,15 @@ st_texture_cache_load_gicon (StTextureCache *cache,
if (ST_IS_IMAGE_CONTENT (icon))
{
+ int width, height;
+
+ g_object_get (G_OBJECT (icon),
+ "preferred-width", &width,
+ "preferred-height", &height,
+ NULL);
+ if (width == 0 && height == 0)
+ return NULL;
+
return g_object_new (CLUTTER_TYPE_ACTOR,
"request-mode", CLUTTER_REQUEST_CONTENT_SIZE,
"width", actor_size,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]