summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-21 23:54:29 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-21 23:54:29 (EDT)
commitf6c1261a62fa56c593a90ce36a3231671b773a19 (patch)
tree91ceb2a5a1f74d756a1d6a256a7b40136ff7d514 /src
parent79fe0321de8239e6f7f366943e902df4c8394d21 (diff)
downloadmarquee-f6c1261a62fa56c593a90ce36a3231671b773a19.zip
marquee-f6c1261a62fa56c593a90ce36a3231671b773a19.tar.gz
marquee-f6c1261a62fa56c593a90ce36a3231671b773a19.tar.bz2
Move tab image callback from MqTabChrome to MqTab
Diffstat (limited to 'src')
-rw-r--r--src/tab-chrome.c17
-rw-r--r--src/tab.c21
2 files changed, 19 insertions, 19 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index fda480f..e205ae4 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -473,13 +473,6 @@ 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
load_changed_cb(WebKitWebView *web_view, WebKitLoadEvent load_event,
MqTabChrome *chrome)
{
@@ -578,13 +571,6 @@ 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
loading_cb(WebKitWebView *web_view,
GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome)
{
@@ -623,9 +609,6 @@ connect_web_view(MqTabChrome *chrome)
G_CALLBACK(load_progress_cb), chrome);
g_signal_connect(chrome->web_view, "notify::uri",
G_CALLBACK(uri_cb), chrome);
- /* FIXME: Doesn't work? */
- g_signal_connect(chrome->web_view, "notify::favicon",
- G_CALLBACK(favicon_cb), chrome);
g_signal_connect(chrome->web_view, "notify::is-loading",
G_CALLBACK(loading_cb), chrome);
}
diff --git a/src/tab.c b/src/tab.c
index 72de9e9..223b751 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -28,6 +28,13 @@
#include "tab-body.h"
static void
+update_tab_image(MqTab *tab)
+{
+ gtk_image_set_from_surface(GTK_IMAGE(tab->tab_image),
+ webkit_web_view_get_favicon(tab->web_view));
+}
+
+static void
update_tab_label(MqTab *tab)
{
gtk_label_set_text(GTK_LABEL(tab->tab_label),
@@ -36,6 +43,13 @@ update_tab_label(MqTab *tab)
}
static void
+favicon_cb(WebKitWebView __attribute__((unused)) *web_view,
+ GParamSpec __attribute__((unused)) *paramspec, MqTab *tab)
+{
+ update_tab_image(tab);
+}
+
+static void
title_cb(WebKitWebView __attribute__((unused)) *web_view,
GParamSpec __attribute__((unused)) *paramspec, MqTab *tab)
{
@@ -53,8 +67,11 @@ mq_tab_new(gchar *uri, GtkWidget *tab_image, GtkWidget *tab_label)
tab->chrome = mq_tab_chrome_new(uri, tab_image, tab_label);
tab->body = mq_tab_body_new(uri);
tab->web_view = mq_tab_body_get_web_view(tab->body);
- g_signal_connect(tab->web_view, "notify::title", G_CALLBACK(title_cb),
- tab);
+ /* FIXME: Doesn't work? */
+ g_signal_connect(tab->web_view, "notify::favicon",
+ G_CALLBACK(favicon_cb), tab);
+ g_signal_connect(tab->web_view, "notify::title",
+ G_CALLBACK(title_cb), tab);
mq_tab_chrome_set_web_view(tab->chrome, tab->web_view);
tab->container = gtk_grid_new();