Index: src/ephy-tabs-menu.c
===================================================================
--- src/ephy-tabs-menu.c	(révision 7493)
+++ src/ephy-tabs-menu.c	(copie de travail)
@@ -122,8 +122,10 @@
 		GtkAction *action)
 {
 	const char *title;
+	EphyEmbed *embed;
 
-	title = ephy_tab_get_title_composite (tab);
+	embed = ephy_tab_get_embed (tab);
+	title = ephy_embed_get_title (embed);
 
 	g_object_set (action, "label", title, NULL);
 }
Index: src/ephy-tab.c
===================================================================
--- src/ephy-tab.c	(révision 7493)
+++ src/ephy-tab.c	(copie de travail)
@@ -85,7 +85,6 @@
 	char *link_message;
 	char *address;
 	char *typed_address;
-	char *title;
 	char *loading_title;
 	char *icon_address;
 	GdkPixbuf *icon;
@@ -136,7 +135,6 @@
 	PROP_SECURITY,
 	PROP_HIDDEN_POPUP_COUNT,
 	PROP_POPUPS_ALLOWED,
-	PROP_TITLE,
 	PROP_TYPED_ADDRESS,
 	PROP_VISIBLE,
 	PROP_ZOOM
@@ -170,9 +168,11 @@
 						 EphyEmbed *embed);
 static void	ephy_tab_set_security_level	(EphyTab *tab,
 						 EphyEmbedSecurityLevel level);
+/*
 static void	ephy_tab_set_title		(EphyTab *tab,
 						 EphyEmbed *embed,
 						 char *new_title);
+*/
 static void	ephy_tab_set_zoom		(EphyTab *tab,
 						 float zoom);
 static guint	popup_blocker_n_hidden		(EphyTab *tab);
@@ -252,7 +252,6 @@
 		case PROP_NAVIGATION:
 		case PROP_SECURITY:
 		case PROP_HIDDEN_POPUP_COUNT:
-		case PROP_TITLE:
 		case PROP_VISIBLE:
 		case PROP_ZOOM:
 			/* read only */
@@ -305,9 +304,11 @@
 			g_value_set_boolean
 				(value, ephy_tab_get_popups_allowed (tab));
 			break;
+			/*
 		case PROP_TITLE:
 			g_value_set_string (value, priv->title);
 			break;
+			*/
 		case PROP_TYPED_ADDRESS:
 			g_value_set_string (value, ephy_tab_get_typed_address (tab));
 			break;
@@ -485,6 +486,7 @@
 							       FALSE,
 							       G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
 
+	/*
 	g_object_class_install_property (object_class,
 					 PROP_TITLE,
 					 g_param_spec_string ("title",
@@ -492,6 +494,7 @@
 							      "The tab's title",
 							      _("Blank page"),
 							      G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+	*/
 
 	g_object_class_install_property (object_class,
 					 PROP_TYPED_ADDRESS,
@@ -840,7 +843,6 @@
 		priv->icon = NULL;
 	}
 
-	g_free (priv->title);
 	g_free (priv->loading_title);
 	g_free (priv->address);
 	g_free (priv->typed_address);
@@ -896,6 +898,7 @@
 }
 
 
+/* Untouched */
 static char *
 get_title_from_address (const char *address)
 {
@@ -918,6 +921,7 @@
 	return title;
 }
 
+/* Needs an update when loading_title will be moved, if ever */
 static void
 ephy_tab_set_loading_title (EphyTab *tab,
 			    const char *title,
@@ -1566,7 +1570,10 @@
 	    strcmp (address, "about:blank") == 0)
 	{
 		ephy_tab_set_address (tab, NULL);
+		/*
 		ephy_tab_set_title (tab, embed, NULL);
+		*/
+		// notify:title was emitted from within ephy_tab_set_title
 	}
 	else
 	{
@@ -1582,7 +1589,10 @@
 	ephy_tab_set_icon_address (tab, NULL);
 	ephy_tab_update_navigation_flags (tab, embed);
 
+	/*
+	g_print ("Notify: title [ephy_tab_address_cb] | ");
 	g_object_notify (object, "title");
+	*/
 
 	g_object_thaw_notify (object);
 }
@@ -1683,9 +1693,15 @@
 
 	g_object_freeze_notify (object);
 
+	/*
 	ephy_tab_set_title (tab, embed, ephy_embed_get_title (embed));
+	*/
+	// notify:title was emitted from within ephy_tab_set_title
 
+	/*
+	  // Should be modified when/if loading_title is moved
 	ephy_tab_set_loading_title (tab, priv->title, FALSE);
+	*/
 
 	g_object_thaw_notify (object);
 }
@@ -1766,7 +1782,10 @@
 		tab->priv->status_message = g_strdup_printf (msg, host);
 		tab->priv->loading_title = g_strdup_printf (msg, host);
 		g_object_notify (G_OBJECT (tab), "message");
+		/*
+		g_print ("Notify title [update_net_state_message] | ");
 		g_object_notify (G_OBJECT (tab), "title");
+		*/
 	}
 
 out:
@@ -1810,11 +1829,13 @@
 		ephy_tab_set_address (tab, g_strdup (address));
 	}
 
-	/* FIXME huh?? */
+	/*
+	  // FIXME huh??
 	if (tab->priv->title == NULL || tab->priv->title[0] == '\0')
 	{
 		ephy_tab_set_title (tab, embed, NULL);
 	}
+	*/
 }
 
 static void
@@ -1844,7 +1865,10 @@
 
 			ensure_page_info (tab, embed, uri);
 
+			/*
+			g_print ("Notify: title [ephy_tab_net_state_cb 1] | ");
 			g_object_notify (object, "title");
+			*/
 
 			g_object_thaw_notify (object);
 		}
@@ -1863,7 +1887,10 @@
 
 			priv->address_expire = EPHY_TAB_ADDRESS_EXPIRE_NOW;
 
+			/*
+			g_print ("Notify: title [ephy_tab_net_state_cb 2] | ");
 			g_object_notify (object, "title");
+			*/
 
 			g_object_thaw_notify (object);
 		}
@@ -2145,13 +2172,11 @@
 	tab->priv->security_level = EPHY_EMBED_STATE_IS_UNKNOWN;
 	tab->priv->document_type = EPHY_EMBED_DOCUMENT_HTML;
 	tab->priv->zoom = 1.0;
-	priv->title = NULL;
 	priv->is_blank = TRUE;
 	priv->icon_address = NULL;
 	priv->icon = NULL;
 	priv->address = NULL;
 	priv->typed_address = NULL;
-	priv->title = NULL;
 	priv->loading_title = NULL;
 	priv->address_expire = EPHY_TAB_ADDRESS_EXPIRE_NOW;
 	priv->reload_delay_ticks = 0;
@@ -2174,9 +2199,11 @@
 	g_signal_connect_object (embed, "ge_location",
 				 G_CALLBACK (ephy_tab_address_cb),
 				 tab, 0);
+	/*
 	g_signal_connect_object (embed, "title",
 				 G_CALLBACK (ephy_tab_title_cb),
 				 tab, 0);
+	*/
 	g_signal_connect_object (embed, "ge_zoom_change",
 				 G_CALLBACK (ephy_tab_zoom_changed_cb),
 				 tab, 0);
@@ -2328,6 +2355,7 @@
 	}
 }
 
+/*
 static void
 ephy_tab_set_title (EphyTab *tab,
 		    EphyEmbed *embed,
@@ -2341,7 +2369,7 @@
 		g_free (title);
 		title = get_title_from_address (priv->address);
 
-		/* Fallback */
+		// Fallback
 		if (title == NULL || title[0] == '\0')
 		{
 			g_free (title);
@@ -2358,8 +2386,10 @@
 	g_free (priv->title);
 	priv->title = ephy_string_shorten (title, MAX_TITLE_LENGTH);
 
+	g_print ("Notify title [ephy_tab_set_title] | ");
 	g_object_notify (G_OBJECT (tab), "title");
 }
+*/
 
 /**
  * ephy_tab_get_title_composite:
@@ -2375,6 +2405,8 @@
 const char *
 ephy_tab_get_title_composite (EphyTab *tab)
 {
+	g_print ("get_title_composite called\n");
+
 	EphyTabPrivate *priv;
 	const char *title = "";
 
@@ -2393,10 +2425,12 @@
 	}
 	else
 	{
+		/*
 		title = priv->title;
+		*/
 	}
 
-	return title != NULL ? title : "";
+	return title != NULL ? title : "COMPOSITED TITLE";
 }
 
 /**
@@ -2423,7 +2457,10 @@
 	}
 	else
 	{
+		/*
 		title = priv->title;
+		*/
+		title = "GET_TITLE";
 	}
 
 	return title != NULL ? title : "";
Index: src/ephy-window.c
===================================================================
--- src/ephy-window.c	(révision 7493)
+++ src/ephy-window.c	(copie de travail)
@@ -1708,7 +1708,7 @@
 }
 
 static void
-sync_tab_title (EphyTab *tab,
+sync_tab_title (EphyEmbed *embed,
 		GParamSpec *pspec,
 		EphyWindow *window)
 {
@@ -1716,8 +1716,16 @@
 
 	if (priv->closing) return;
 
+	g_print ("sync_tab_title in src/ephy-window.c\n");
+
+	/*
 	gtk_window_set_title (GTK_WINDOW(window),
 			      ephy_tab_get_title_composite (tab));
+	*/
+
+	if (embed == NULL) return;
+	gtk_window_set_title (GTK_WINDOW (window),
+			      ephy_embed_get_title (embed));
 }
 
 static void
@@ -2207,9 +2215,6 @@
 						      G_CALLBACK (sync_tab_popups_allowed),
 						      window);
 		g_signal_handlers_disconnect_by_func (old_tab,
-						      G_CALLBACK (sync_tab_title),
-						      window);
-		g_signal_handlers_disconnect_by_func (old_tab,
 						      G_CALLBACK (sync_tab_zoom),
 						      window);
 
@@ -2218,6 +2223,8 @@
 			(embed, G_CALLBACK (tab_context_menu_cb), window);
 		g_signal_handlers_disconnect_by_func
 			(embed, G_CALLBACK (tab_size_to_cb), window);
+		g_signal_handlers_disconnect_by_func
+			(embed, G_CALLBACK (sync_tab_title), window);
 
 	}
 
@@ -2235,7 +2242,6 @@
 		sync_tab_security	(new_tab, NULL, window);
 		sync_tab_popup_windows	(new_tab, NULL, window);
 		sync_tab_popups_allowed	(new_tab, NULL, window);
-		sync_tab_title		(new_tab, NULL, window);
 		sync_tab_zoom		(new_tab, NULL, window);
 
 		g_signal_connect_object (new_tab, "notify::address",
@@ -2268,9 +2274,11 @@
 		g_signal_connect_object (new_tab, "notify::popups-allowed",
 					 G_CALLBACK (sync_tab_popups_allowed),
 					 window, 0);
+		/*
 		g_signal_connect_object (new_tab, "notify::title",
 					 G_CALLBACK (sync_tab_title),
 					 window, 0);
+		*/
 		g_signal_connect_object (new_tab, "notify::zoom",
 					 G_CALLBACK (sync_tab_zoom),
 					 window, 0);
@@ -2282,6 +2290,11 @@
 		g_signal_connect_object (embed, "size-to",
 					 G_CALLBACK (tab_size_to_cb),
 					 window, 0);
+		g_signal_connect_object (embed, "notify::title",
+					 G_CALLBACK (sync_tab_title),
+					 window, 0);
+		g_print ("Unconditional call (ephy-window.c): ");
+		sync_tab_title		(embed, NULL, window);
 
 		g_object_notify (G_OBJECT (window), "active-tab");
 	}
Index: embed/mozilla/mozilla-embed.cpp
===================================================================
--- embed/mozilla/mozilla-embed.cpp	(révision 7493)
+++ embed/mozilla/mozilla-embed.cpp	(copie de travail)
@@ -46,12 +46,16 @@
 
 #include "mozilla-embed.h"
 
+#include <glib/gi18n.h>
+
 static void	mozilla_embed_class_init	(MozillaEmbedClass *klass);
 static void	mozilla_embed_init		(MozillaEmbed *gs);
 static void	mozilla_embed_destroy		(GtkObject *object);
 static void	mozilla_embed_finalize		(GObject *object);
 static void	ephy_embed_iface_init		(EphyEmbedIface *iface);
 
+static void mozilla_embed_title_cb		(GtkMozEmbed *embed,
+						 MozillaEmbed *membed);
 static void mozilla_embed_location_changed_cb	(GtkMozEmbed *embed,
 						 MozillaEmbed *membed);
 static void mozilla_embed_net_state_all_cb	(GtkMozEmbed *embed,
@@ -76,6 +80,14 @@
 						 gpointer request,
 						 PRUint32 state,
 						 MozillaEmbed *membed);
+static void mozilla_embed_get_property		(GObject *object,
+						 guint prop_id,
+						 GValue *value,
+						 GParamSpec *pspec);
+static void mozilla_embed_set_property		(GObject *object,
+						 guint prop_id,
+						 const GValue *value,
+						 GParamSpec *pspec);
 static EphyEmbedSecurityLevel mozilla_embed_security_level (PRUint32 state);
 
 #define MOZILLA_EMBED_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), MOZILLA_TYPE_EMBED, MozillaEmbedPrivate))
@@ -88,10 +100,19 @@
 	MOZILLA_EMBED_LOAD_STOPPED
 } MozillaEmbedLoadState;
 
+enum
+{
+	PROP_0,
+	PROP_TITLE
+};
+
 struct MozillaEmbedPrivate
 {
 	EphyBrowser *browser;
 	MozillaEmbedLoadState load_state;
+
+	/* Properties */
+	char *title;
 };
 
 #define WINDOWWATCHER_CONTRACTID "@mozilla.org/embedcomp/window-watcher;1"
@@ -243,12 +264,23 @@
 	object_class->constructor = mozilla_embed_constructor;
 	object_class->finalize = mozilla_embed_finalize;
 
+	object_class->get_property = mozilla_embed_get_property;
+	object_class->set_property = mozilla_embed_set_property;
+
 	gtk_object_class->destroy = mozilla_embed_destroy;
 
 	widget_class->grab_focus = mozilla_embed_grab_focus;
 	widget_class->realize = mozilla_embed_realize;
 
 	g_type_class_add_private (object_class, sizeof(MozillaEmbedPrivate));
+
+	g_object_class_install_property (object_class,
+					 PROP_TITLE,
+					 g_param_spec_string ("title",
+							      "Title",
+							      "The embed's title",
+							      _("Blank page"),
+							      (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)));
 }
 
 static void
@@ -256,7 +288,11 @@
 {
         embed->priv = MOZILLA_EMBED_GET_PRIVATE (embed);
 	embed->priv->browser = new EphyBrowser ();
+	embed->priv->title = NULL;
 
+	g_signal_connect_object (embed, "title",
+				 G_CALLBACK (mozilla_embed_title_cb),
+				 embed, (GConnectFlags) 0);
 	g_signal_connect_object (embed, "location",
 				 G_CALLBACK (mozilla_embed_location_changed_cb),
 				 embed, (GConnectFlags) 0);
@@ -312,6 +348,8 @@
 	       	embed->priv->browser = nsnull;
 	}
 
+	g_free (embed->priv->title);
+
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 
 	g_object_unref (embed_shell);
@@ -849,6 +887,23 @@
 }
 
 static void
+mozilla_embed_title_cb (GtkMozEmbed *embed,
+			MozillaEmbed *membed)
+{
+	/* Get the title from the embed,
+	 * store it as a property,
+	 * emit the notify signal
+	 */
+
+	MozillaEmbedPrivate *priv = membed->priv;
+
+	g_free (priv->title);
+	priv->title = gtk_moz_embed_get_title (embed);
+
+	g_object_notify (G_OBJECT (membed), "title");
+}
+
+static void
 mozilla_embed_location_changed_cb (GtkMozEmbed *embed, 
 				   MozillaEmbed *membed)
 {
@@ -1222,6 +1277,8 @@
 xul_title_cb (GtkMozEmbed *embed,
 	      GtkWindow *window)
 {
+	g_print ("xul_title_cb\n");
+
 	char *title;
 
 	title = gtk_moz_embed_get_title (embed);
@@ -1266,3 +1323,37 @@
 
 	return GTK_MOZ_EMBED (embed);
 }
+
+static void
+mozilla_embed_get_property (GObject *object,
+			    guint prop_id,
+			    GValue *value,
+			    GParamSpec *pspec)
+{
+	MozillaEmbed *embed = MOZILLA_EMBED (object);
+	MozillaEmbedPrivate *priv = embed->priv;
+
+	switch (prop_id)
+	{
+		case PROP_TITLE:
+			g_value_set_string (value, priv->title);
+			break;
+	}
+}
+
+static void
+mozilla_embed_set_property (GObject *object,
+			    guint prop_id,
+			    const GValue *value,
+			    GParamSpec *pspec)
+{
+	MozillaEmbed *embed = MOZILLA_EMBED (object);
+	MozillaEmbedPrivate *priv = embed->priv;
+
+	switch (prop_id)
+	{
+		case PROP_TITLE:
+			/* read only */
+			break;
+	}
+}
