diff options
author | Marco Peereboom <marco@conformal.com> | 2011-10-27 15:19:55 -0500 |
---|---|---|
committer | Marco Peereboom <marco@conformal.com> | 2011-10-27 15:19:55 -0500 |
commit | 4b65c5f128cc168a85738031fb1d50d09cf50c33 (patch) | |
tree | c390e7476028ddd37893e510f9a5886ca8073996 /xxxterm.c | |
parent | 54bbb5517118e2579605e2fae94994d476668c97 (diff) | |
download | xombrero-4b65c5f128cc168a85738031fb1d50d09cf50c33.tar.gz |
add autofocus_onload option
When set the browser will attempt to enable the default input on a website. Off by default
Diffstat (limited to 'xxxterm.c')
-rw-r--r-- | xxxterm.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 |