[Xfce4-commits] <midori:master> Handle window icon inside MidoriBrowser

Christian Dywan noreply at xfce.org
Tue Jan 24 23:58:01 CET 2012


Updating branch refs/heads/master
         to fb44d46db0e80f1eaa5ee4d52c0fe8b26ec18c90 (commit)
       from 7fd1c2e5e16244845deac69d1efda1306751b866 (commit)

commit fb44d46db0e80f1eaa5ee4d52c0fe8b26ec18c90
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Jan 24 23:26:09 2012 +0100

    Handle window icon inside MidoriBrowser
    
    Fixes: https://bugs.launchpad.net/midori/+bug/918567

 midori/main.c           |   18 ------------------
 midori/midori-browser.c |    9 +++++++++
 2 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index e7843d1..24c01e5 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -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 ()),
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 7cc7cba..2adf58b 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -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",


More information about the Xfce4-commits mailing list