From 27189c42c6f7d8977eede94f4b418e4fef736af4 Mon Sep 17 00:00:00 2001
From: Patrick McDermott <pj@pehjota.net>
Date: Sun, 17 Sep 2017 13:59:54 -0400
Subject: src/tab-chrome.c: Handle change of target from link to link

---
(limited to 'src')

diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 93878fd..7b3d1e5 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -223,6 +223,15 @@ mouse_target_changed_cb(WebKitWebView __attribute__((unused)) *web_view,
 					hit_test_result));
 			gtk_entry_set_attributes(GTK_ENTRY(chrome->uri_entry),
 				chrome->hovered_link_style);
+		} else if (gtk_entry_get_attributes(
+					GTK_ENTRY(chrome->uri_entry)) ==
+				chrome->hovered_link_style) {
+			/* The URI bar's text differs from the Web view's URI
+			 * because the mouse was already targeting a different
+			 * link. */
+			gtk_entry_set_text(GTK_ENTRY(chrome->uri_entry),
+				webkit_hit_test_result_get_link_uri(
+					hit_test_result));
 		}
 	} else {
 		if (gtk_entry_get_attributes(GTK_ENTRY(chrome->uri_entry)) ==
--
cgit v0.9.1