summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-17 03:10:52 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-17 03:10:52 (EDT)
commitc382b0211cf4fa55ce90b94d06571e3e6d8bd52c (patch)
tree69a4968ab5ad70a209df9a80af89b006f091f678 /src
parentf27afc611a387caf8c5774b4c167f2b9295e5be2 (diff)
downloadmarquee-c382b0211cf4fa55ce90b94d06571e3e6d8bd52c.zip
marquee-c382b0211cf4fa55ce90b94d06571e3e6d8bd52c.tar.gz
marquee-c382b0211cf4fa55ce90b94d06571e3e6d8bd52c.tar.bz2
src/tab-chrome.c: (Try to) update favicon in tab
Diffstat (limited to 'src')
-rw-r--r--src/tab-chrome.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index e53e037..a66da19 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -91,6 +91,13 @@ mq_tab_chrome_get_container(MqTabChrome *chrome)
}
static void
+update_tab_image(MqTabChrome *chrome)
+{
+ gtk_image_set_from_surface(GTK_IMAGE(chrome->tab_image),
+ webkit_web_view_get_favicon(chrome->web_view));
+}
+
+static void
update_tab_label(MqTabChrome *chrome)
{
gtk_label_set_text(GTK_LABEL(chrome->tab_label),
@@ -140,6 +147,13 @@ uri_cb(WebKitWebView *web_view, GParamSpec __attribute__((unused)) *paramspec,
}
static void
+favicon_cb(WebKitWebView __attribute__((unused)) *web_view,
+ GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome)
+{
+ update_tab_image(chrome);
+}
+
+static void
title_cb(WebKitWebView __attribute__((unused)) *web_view,
GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome)
{
@@ -155,6 +169,8 @@ connect_web_view(MqTabChrome *chrome)
G_CALLBACK(load_progress_cb), chrome);
g_signal_connect(chrome->web_view, "notify::uri",
G_CALLBACK(uri_cb), chrome);
+ g_signal_connect(chrome->web_view, "notify::favicon",
+ G_CALLBACK(favicon_cb), chrome);
g_signal_connect(chrome->web_view, "notify::title",
G_CALLBACK(title_cb), chrome);
}