]> spindle.queued.net Git - midori/commitdiff
Use the icon of the view for the window in web app mode
authorChristian Dywan <christian@twotoasts.de>
Thu, 16 Jul 2009 21:45:45 +0000 (23:45 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 16 Jul 2009 21:45:45 +0000 (23:45 +0200)
midori/main.c

index 203c20b5548c19d41200a6183dfc3ab13a888ad9..a6718fca0a57208275243f1fda3d7f0d175f1cd9 100644 (file)
@@ -1401,6 +1401,19 @@ snapshot_load_finished_cb (GtkWidget*      web_view,
 }
 #endif
 
+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));
+        gtk_window_set_icon (GTK_WINDOW (browser), icon);
+    }
+}
+
 int
 main (int    argc,
       char** argv)
@@ -1554,6 +1567,8 @@ main (int    argc,
                       NULL);
         g_object_unref (settings);
         g_object_set (browser, "settings", settings, NULL);
+        g_signal_connect (browser, "notify::load-status",
+            G_CALLBACK (midori_web_app_browser_notify_load_status_cb), NULL);
         midori_browser_add_uri (browser, webapp);
         g_object_set_data (G_OBJECT (browser), "locked", (void*)1);
         g_signal_connect (browser, "destroy",