Handle window icon inside MidoriBrowser

Fixes: https://bugs.launchpad.net/midori/+bug/918567
This commit is contained in:
Christian Dywan 2012-01-24 23:26:09 +01:00
parent 7fd1c2e5e1
commit fb44d46db0
2 changed files with 9 additions and 18 deletions

View file

@ -1477,21 +1477,6 @@ snapshot_load_finished_cb (GtkWidget* web_view,
gtk_main_quit ();
}
static void
midori_web_app_browser_notify_load_status_cb (MidoriBrowser* browser,
GParamSpec* pspec,
gpointer data)
{
if (katze_object_get_enum (browser, "load-status") != MIDORI_LOAD_PROVISIONAL)
{
GtkWidget* view = midori_browser_get_current_tab (browser);
GdkPixbuf* icon = midori_view_get_icon (MIDORI_VIEW (view));
if (midori_view_is_blank (MIDORI_VIEW (view)))
icon = NULL;
gtk_window_set_icon (GTK_WINDOW (browser), icon);
}
}
static MidoriBrowser*
midori_web_app_browser_new_window_cb (MidoriBrowser* browser,
MidoriBrowser* new_browser,
@ -2132,9 +2117,6 @@ main (int argc,
{
SoupSession* session = webkit_get_default_session ();
MidoriBrowser* browser = midori_browser_new ();
/* Update window icon according to page */
g_signal_connect (browser, "notify::load-status",
G_CALLBACK (midori_web_app_browser_notify_load_status_cb), NULL);
g_signal_connect (browser, "new-window",
G_CALLBACK (midori_web_app_browser_new_window_cb), NULL);
g_object_set_data (G_OBJECT (webkit_get_default_session ()),

View file

@ -380,6 +380,8 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
{
midori_location_action_set_text (location_action, browser->statusbar_text);
midori_location_action_set_icon (location_action, NULL);
if (sokoke_is_app_or_private ())
gtk_window_set_icon (GTK_WINDOW (browser), NULL);
midori_location_action_set_secondary_icon (location_action, NULL);
}
else
@ -397,6 +399,9 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
midori_view_get_display_uri (MIDORI_VIEW (view)));
midori_location_action_set_icon (location_action,
midori_view_get_icon (MIDORI_VIEW (view)));
if (sokoke_is_app_or_private ())
gtk_window_set_icon (GTK_WINDOW (browser),
midori_view_get_icon (MIDORI_VIEW (view)));
}
}
}
@ -492,6 +497,8 @@ midori_view_notify_icon_cb (MidoriView* view,
MIDORI_LOCATION_ACTION (action), midori_view_get_icon (view), uri);
midori_location_action_set_icon (MIDORI_LOCATION_ACTION (action),
midori_view_get_icon (view));
if (sokoke_is_app_or_private ())
gtk_window_set_icon (GTK_WINDOW (browser), midori_view_get_icon (view));
}
static void
@ -5049,6 +5056,8 @@ gtk_notebook_switch_page_after_cb (GtkWidget* notebook,
midori_location_action_set_text (MIDORI_LOCATION_ACTION (action), uri);
midori_location_action_set_icon (MIDORI_LOCATION_ACTION (action),
midori_view_get_icon (view));
if (sokoke_is_app_or_private ())
gtk_window_set_icon (GTK_WINDOW (browser), midori_view_get_icon (view));
if (browser->proxy_array)
katze_item_set_meta_integer (KATZE_ITEM (browser->proxy_array), "current",