[gnome-builder/wip/gtk4-port] libide/webkit: add fallback icon when no favicon is available



commit 20ea29b258b4b3a16ba09368b612e2f46ca0cdb2
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jun 3 14:30:10 2022 -0700

    libide/webkit: add fallback icon when no favicon is available

 src/libide/webkit/ide-webkit-page.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/webkit/ide-webkit-page.c b/src/libide/webkit/ide-webkit-page.c
index 688c93cbf..8e1b30ceb 100644
--- a/src/libide/webkit/ide-webkit-page.c
+++ b/src/libide/webkit/ide-webkit-page.c
@@ -81,14 +81,18 @@ transform_cairo_surface_to_gicon (GBinding     *binding,
   int height;
 
   g_assert (G_IS_BINDING (binding));
-  g_assert (from_value != NULL);
-  g_assert (to_value != NULL);
+  g_assert (G_VALUE_HOLDS_POINTER (from_value));
+  g_assert (G_VALUE_HOLDS_OBJECT (to_value));
   g_assert (IDE_IS_WEBKIT_PAGE (self));
 
   /* No ownership transfer */
   surface = g_value_get_pointer (from_value);
+
   if (surface == NULL)
-    return TRUE;
+    {
+      g_value_take_object (to_value, g_themed_icon_new ("web-browser-symbolic"));
+      return TRUE;
+    }
 
   width = 16 * gtk_widget_get_scale_factor (GTK_WIDGET (self));
   height = 16 * gtk_widget_get_scale_factor (GTK_WIDGET (self));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]