diff options
-rw-r--r-- | xxxterm.1 | 4 | ||||
-rw-r--r-- | xxxterm.c | 9 | ||||
-rw-r--r-- | xxxterm.conf | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/xxxterm.1 b/xxxterm.1 index d5325b0..4225559 100644 --- a/xxxterm.1 +++ b/xxxterm.1 @@ -857,6 +857,10 @@ Unfortunately enabling this does allow for some limited tracking on the web. .It Cm append_next When set a new tab is appended after the current tab instead of being appended as the last tab. +.It Cm autofocus_onload +When set a tab that is loaded will attempt to autofocus the default input +entry. +This is only done for tabs that are currently visible. .It Cm browser_mode The .Nm diff --git a/xxxterm.c b/xxxterm.c index 57e4a80..a8825b7 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -615,6 +615,7 @@ int history_autosave = 0; char search_file[PATH_MAX]; char command_file[PATH_MAX]; char *encoding = NULL; +int autofocus_onload = 0; char *cmd_font_name = NULL; char *oops_font_name = NULL; @@ -773,8 +774,9 @@ struct settings { gfloat *fval; int (*activate)(char *); } rs[] = { - { "append_next", XT_S_INT, 0, &append_next, NULL, NULL }, { "allow_volatile_cookies", XT_S_INT, 0, &allow_volatile_cookies, NULL, NULL }, + { "append_next", XT_S_INT, 0, &append_next, NULL, NULL }, + { "autofocus_onload", XT_S_INT, 0, &autofocus_onload, NULL, NULL }, { "browser_mode", XT_S_INT, 0, NULL, NULL,&s_browser_mode }, { "cookie_policy", XT_S_INT, 0, NULL, NULL,&s_cookie }, { "cookies_enabled", XT_S_INT, 0, &cookies_enabled, NULL, NULL }, @@ -7230,8 +7232,11 @@ void webview_load_finished_cb(WebKitWebView *wv, WebKitWebFrame *wf, struct tab *t) { run_script(t, JS_HINTING); - if (t->tab_id == gtk_notebook_get_current_page(notebook)) + if (autofocus_onload && + t->tab_id == gtk_notebook_get_current_page(notebook)) run_script(t, "hints.focusInput();"); + else + run_script(t, "hints.clearFocus();"); } void diff --git a/xxxterm.conf b/xxxterm.conf index 95d2517..fc3a3ef 100644 --- a/xxxterm.conf +++ b/xxxterm.conf @@ -33,6 +33,7 @@ # spell_check_languages = en_US # xterm_workaround = 1 # history_autosave = 1 +# autofocus_onload = 1 # encoding = ISO-8859-1 # |