commit 237ea2b666faf498dfb4ef271d04c4f5798f8647
Author: alex <alex@livonia.localdomain>
Date:   Tue Jan 5 14:11:14 2010 +0100

    Fix problem with the tab loading title
    
    The logic of the title selection was not correct when loading,
    the tabs were using title instead of the composited title. We have
    added a new variable to control the moment we receive the webpage
    title and we use it to select the title in each moment.
    
    Bug #593743

diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 6b717a0..d2a1dce 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -84,6 +84,7 @@ struct _EphyWebViewPrivate {
   char *link_message;
   GdkPixbuf *icon;
   gboolean expire_address_now;
+  gboolean title_received;
 
   /* File watch */
   GFileMonitor *monitor;
@@ -1969,6 +1970,7 @@ ephy_web_view_init (EphyWebView *web_view)
   priv->is_blank = TRUE;
   priv->load_status = WEBKIT_LOAD_PROVISIONAL;
   priv->title = g_strdup (EMPTY_PAGE);
+  priv->title_received = FALSE;
   priv->document_type = EPHY_WEB_VIEW_DOCUMENT_HTML;
   priv->security_level = EPHY_WEB_VIEW_STATE_IS_UNKNOWN;
   priv->monitor_directory = FALSE;
@@ -2232,6 +2234,9 @@ ephy_web_view_set_title (EphyWebView *view,
   EphyWebViewPrivate *priv = view->priv;
   char *title = g_strdup (view_title);
 
+  if (!title)
+    priv->title_received = FALSE;
+
   if (!priv->is_blank && (title == NULL || g_strstrip (title)[0] == '\0')) {
     g_free (title);
     title = get_title_from_address (priv->address);
@@ -2245,6 +2250,8 @@ ephy_web_view_set_title (EphyWebView *view,
   } else if (priv->is_blank) {
     g_free (title);
     title = g_strdup (EMPTY_PAGE);
+  } else {
+    priv->title_received = TRUE;
   }
 
   g_free (priv->title);
@@ -2348,7 +2355,7 @@ update_net_state_message (EphyWebView *view, const char *uri, EphyWebViewNetStat
     g_free (view->priv->status_message);
     g_free (view->priv->loading_title);
     view->priv->status_message = g_strdup_printf (msg, host);
-    view->priv->loading_title = g_strdup_printf (msg, host);
+    ephy_web_view_set_loading_title (view, NULL, FALSE);
     g_object_notify (G_OBJECT (view), "status-message");
     g_object_notify (G_OBJECT (view), "embed-title");
   }
@@ -2647,7 +2654,7 @@ ephy_web_view_location_changed (EphyWebView *view,
     /* we do this to get rid of an eventual password in the URL */
     view_address = ephy_web_view_get_location (view, TRUE);
     ephy_web_view_set_address (view, view_address);
-    ephy_web_view_set_loading_title (view, view_address, TRUE);
+    ephy_web_view_set_loading_title (view, NULL, FALSE);
     g_free (view_address);
   }
 
@@ -3179,6 +3186,7 @@ ephy_web_view_get_title_composite (EphyWebView *view)
   const char *title = "";
   const char *loading_title;
   gboolean is_loading, is_blank;
+  EphyWebViewPrivate *priv = EPHY_WEB_VIEW (view)->priv;
 
   g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), NULL);
 
@@ -3193,7 +3201,8 @@ ephy_web_view_get_title_composite (EphyWebView *view)
       title = loading_title;
     else
       title = _("Blank page");
-  }
+  } else if ((!priv->title_received)&&(is_loading))
+    title = loading_title;
 
   return title != NULL ? title : "";
 }
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 8dbb10e..d0ccbbc 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -537,7 +537,7 @@ sync_label (EphyWebView *view, GParamSpec *pspec, GtkWidget *label)
 {
 	const char *title;
 
-	title = ephy_web_view_get_title (view);
+	title = ephy_web_view_get_title_composite (view);
 
 	gtk_label_set_text (GTK_LABEL (label), title);
 
