diff options
author | portix <none@none> | 2012-11-11 21:50:04 +0100 |
---|---|---|
committer | portix <none@none> | 2012-11-11 21:50:04 +0100 |
commit | 098abfd249783d7c77c065949c5fd6c6174966d7 (patch) | |
tree | d94d85b1e8db196c5742691ef05a470ca1b18be3 /src | |
parent | 1f16bf084a48700c8184617d0d5fad7f071f63d6 (diff) | |
download | dwb-098abfd249783d7c77c065949c5fd6c6174966d7.zip |
New option 'hints-key-lock'
Diffstat (limited to 'src')
-rw-r--r-- | src/config.h | 2 | ||||
-rw-r--r-- | src/dwb.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/config.h b/src/config.h index d0d208cc..bddf686a 100644 --- a/src/config.h +++ b/src/config.h @@ -1171,4 +1171,6 @@ static WebSettings DWB_SETTINGS[] = { SETTING_GLOBAL, CHAR, { .p = NULL }, NULL, { 0 }, }, { { "show-single-tab", "Whether to show tabbar if only on tab is opened", }, SETTING_GLOBAL | SETTING_ONINIT, BOOLEAN, { .b = true }, (S_Func)dwb_set_show_single_tab, { 0 }, }, + { { "hints-key-lock", "Timeout keypresses are ignored after following a hint", }, + SETTING_GLOBAL, INTEGER, { .i = 250 }, NULL, { 0 }, }, };/*}}}*/ @@ -1743,6 +1743,12 @@ dwb_save_searchengine(char *search_engine) { g_free(text); }/*}}}*/ +gboolean +dwb_hints_unlock() { + dwb.state.scriptlock = 0; + return false; +} + /* dwb_evaluate_hints(const char *buffer) return DwbStatus {{{*/ DwbStatus dwb_evaluate_hints(const char *buffer) { @@ -1757,7 +1763,11 @@ dwb_evaluate_hints(const char *buffer) { ret = STATUS_END; } else if (!g_strcmp0(buffer, "_dwb_click_") && HINT_NOT_RAPID ) { - dwb.state.scriptlock = 1; + int timeout = GET_INT("hints-key-lock"); + if (timeout > 0) { + dwb.state.scriptlock = 1; + g_timeout_add(timeout, dwb_hints_unlock, NULL); + } if ( !(dwb.state.nv & OPEN_DOWNLOAD) ) { dwb_change_mode(NORMAL_MODE, dwb.state.message_id == 0); ret = STATUS_END; @@ -2992,7 +3002,6 @@ dwb_clean_vars() { dwb.state.nummod = -1; dwb.state.nv = OPEN_NORMAL; dwb.state.type = 0; - dwb.state.scriptlock = 0; dwb.state.dl_action = DL_ACTION_DOWNLOAD; if (dwb.state.mimetype_request) { FREE0(dwb.state.mimetype_request); |