aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-08-21 15:21:43 +0800
committerXan Lopez <xan@gnome.org>2009-08-21 15:21:43 +0800
commit553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457 (patch)
treefd21a35fcedf8729e87c29c8116c403a5710f55b /embed/ephy-embed.c
parentfc4196b0187aed4444f8e5637a2105be67316aa5 (diff)
downloadgsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar.gz
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar.bz2
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar.lz
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar.xz
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.tar.zst
gsoc2013-epiphany-553b5f4d4cf0ff8e782cbcc0117cc08d6eaae457.zip
ephy-embed.c: update URL in location when clicking on #anchors
Bug #584506
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r--embed/ephy-embed.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index f9f9c53b6..2a786e3a6 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -107,6 +107,26 @@ G_DEFINE_TYPE_WITH_CODE (EphyEmbed, ephy_embed, GTK_TYPE_SCROLLED_WINDOW,
ephy_command_manager_iface_init))
static void
+uri_changed_cb (WebKitWebView *web_view,
+ GParamSpec *spec,
+ EphyEmbed *embed)
+{
+ char *uri;
+ const char *current_address;
+
+ g_object_get (web_view, "uri", &uri, NULL);
+ current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view));
+
+ /* We need to check if we get URI notifications without going
+ through the usual load process, as this can happen when changing
+ location within a page */
+ if (g_str_equal (uri, current_address) == FALSE)
+ ephy_web_view_set_address (EPHY_WEB_VIEW (web_view), uri);
+
+ g_free (uri);
+}
+
+static void
title_changed_cb (WebKitWebView *web_view,
GParamSpec *spec,
EphyEmbed *embed)
@@ -683,6 +703,7 @@ ephy_embed_constructed (GObject *object)
"signal::download-requested", G_CALLBACK (download_requested_cb), embed,
"signal::notify::zoom-level", G_CALLBACK (zoom_changed_cb), embed,
"signal::notify::title", G_CALLBACK (title_changed_cb), embed,
+ "signal::notify::uri", G_CALLBACK (uri_changed_cb), embed,
NULL);
embed->priv->inspector_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);