diff options
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r-- | src/ephy-window.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index d014e4378..dcba93e42 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -451,10 +451,17 @@ setup_layout_menus (EphyWindow *window) } static void +favicon_cache_changed_cb (EphyFaviconCache *cache, char *url, EphyWindow *window) +{ + ephy_window_update_control (window, FaviconControl); +} + +static void ephy_window_init (EphyWindow *window) { BonoboUIComponent *ui_component; Session *session; + EphyFaviconCache *cache; session = ephy_shell_get_session (ephy_shell); @@ -466,6 +473,13 @@ ephy_window_init (EphyWindow *window) window->priv->closing = FALSE; window->priv->has_default_size = FALSE; + cache = ephy_embed_shell_get_favicon_cache (EPHY_EMBED_SHELL (ephy_shell)); + g_signal_connect_object (G_OBJECT (cache), + "changed", + G_CALLBACK (favicon_cache_changed_cb), + window, + 0); + /* Setup the window and connect verbs */ setup_bonobo_window (window, &ui_component); window->ui_component = G_OBJECT (ui_component); @@ -1066,6 +1080,21 @@ update_favorites_control (EphyWindow *window) static void update_favicon_control (EphyWindow *window) { + const char *location; + EphyFaviconCache *cache; + + cache = ephy_embed_shell_get_favicon_cache + (EPHY_EMBED_SHELL (ephy_shell)); + + location = ephy_tab_get_location (window->priv->active_tab); + if (location) + { + GdkPixbuf *pixbuf; + + pixbuf = ephy_favicon_cache_lookup_direct (cache, location); + gtk_window_set_icon (GTK_WINDOW (window), pixbuf); + } + toolbar_update_favicon (window->priv->toolbar); } |