summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tab.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tab.c b/src/tab.c
index 04ff082..6f3a539 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -30,7 +30,12 @@
static void
update_tab_image(MqTab *tab, GdkPixbuf *favicon)
{
- gtk_image_set_from_pixbuf(GTK_IMAGE(tab->tab_image), favicon);
+ if (favicon) {
+ gtk_image_set_from_pixbuf(GTK_IMAGE(tab->tab_image), favicon);
+ } else {
+ gtk_image_set_from_icon_name(GTK_IMAGE(tab->tab_image),
+ "text-x-generic", GTK_ICON_SIZE_BUTTON);
+ }
}
static void
@@ -289,6 +294,7 @@ favicon_cb(WebKitWebView __attribute__((unused)) *web_view,
GdkPixbuf *scaled_pixbuf;
surface = webkit_web_view_get_favicon(tab->web_view);
+ scaled_pixbuf = NULL;
if (surface) {
pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0,
cairo_image_surface_get_width(surface),
@@ -297,11 +303,10 @@ favicon_cb(WebKitWebView __attribute__((unused)) *web_view,
scaled_pixbuf = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
GDK_INTERP_BILINEAR);
g_object_unref(pixbuf);
- if (scaled_pixbuf) {
- update_tab_image(tab, scaled_pixbuf);
- }
}
}
+
+ update_tab_image(tab, scaled_pixbuf);
}
static void