about summary refs log tree commit diff stats
path: root/xxxterm.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-11-09 16:14:05 -0600
committerMarco Peereboom <marco@conformal.com>2011-11-09 16:14:05 -0600
commit005de0eb6cbbf605e929f13a928ca81ceae50877 (patch)
tree941f878f66228581405e002c24b5582f7316483a /xxxterm.c
parent11a06994df648bea20c2440c658ce887b74c81b5 (diff)
downloadxombrero-005de0eb6cbbf605e929f13a928ca81ceae50877.tar.gz
only set mode if focus succeeds
Diffstat (limited to 'xxxterm.c')
-rw-r--r--xxxterm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xxxterm.c b/xxxterm.c
index fac842f..6f879d6 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -4211,8 +4211,10 @@ webview_load_finished_cb(WebKitWebView *wv, WebKitWebFrame *wf, struct tab *t)
 
 	if (autofocus_onload &&
 	    t->tab_id == gtk_notebook_get_current_page(notebook)) {
-		focus_input(t);
-		t->mode = XT_MODE_INSERT;
+		if (focus_input(t))
+			t->mode = XT_MODE_INSERT;
+		else
+			t->mode = XT_MODE_COMMAND;
 	} else {
 		if (dom_is_input(t, &active))
 			if (active)