]> spindle.queued.net Git - midori/commitdiff
Handle window icon inside MidoriBrowser
authorChristian Dywan <christian@twotoasts.de>
Tue, 24 Jan 2012 22:26:09 +0000 (23:26 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 24 Jan 2012 22:57:40 +0000 (23:57 +0100)
Fixes: https://bugs.launchpad.net/midori/+bug/918567
midori/main.c
midori/midori-browser.c

index e7843d12a600350cf68338e9ce06c96386159706..24c01e5992583cfd7461e665824272013f88b88b 100644 (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 ()),
index 7cc7cbabaa7ccebfe19b0c230506c5a240b2bcd8..2adf58b491d99ea7f751becabdf73e778429ddda 100644 (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",