about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-05 10:10:34 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-05 10:10:34 -0400
commit72ce72c612c1782aa9293e9798768f3ca808e736 (patch)
treeb88f3ba020af7dda51e356bc69e2507efb1de509 /xombrero.c
parenta5b5e1de045cab38f969984f66addc840a7fb89c (diff)
downloadxombrero-72ce72c612c1782aa9293e9798768f3ca808e736.tar.gz
Make the autofocus code a bit smarter by first saving the original
text in the text box and seeing if it's any different from the new
text before attempting to enter command mode.  Before, there was only
a check to see if there was any text.  This also only sets t->active
if it is not NULL, so only the page's default text entry box is ever
used when entering insert_mode, instead of the last text box that was
typed into.
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xombrero.c b/xombrero.c
index 3802e0e..0b5c10d 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -4122,6 +4122,10 @@ notify_load_status_cb(WebKitWebView* wview, GParamSpec* pspec, struct tab *t)
 
 		/* DOM is changing, unreference the previous focused element */
 		t->active = NULL;
+		if (t->active_text) {
+			g_free(t->active_text);
+			t->active_text = NULL;
+		}
 
 		/* take focus if we are visible */
 		focus_webview(t);