Document *doc = webkit_web_view_get_dom_document(view);
Element *active = get_active_element(doc);
- /* the focus was not set automatically - add event listener to track focus
- * events on the document */
- if (!auto_insert(active)) {
+ if (vb.config.strict_focus || !auto_insert(active)) {
+ /* if the strict-focus is on also blur the possible active element */
+ if (vb.config.strict_focus) {
+ dom_clear_focus(view);
+ }
+ /* the focus was not set automatically - add event listener to track
+ * focus events on the document */
HtmlElement *element = webkit_dom_document_get_body(doc);
if (!element) {
element = WEBKIT_DOM_HTML_ELEMENT(webkit_dom_document_get_document_element(doc));
static gboolean input_style(const Setting *s, const SettingType type);
static gboolean completion_style(const Setting *s, const SettingType type);
static gboolean strict_ssl(const Setting *s, const SettingType type);
+static gboolean strict_focus(const Setting *s, const SettingType type);
static gboolean ca_bundle(const Setting *s, const SettingType type);
static gboolean home_page(const Setting *s, const SettingType type);
static gboolean download_path(const Setting *s, const SettingType type);
{NULL, "proxy", TYPE_BOOLEAN, proxy, {0}},
{NULL, "cookie-timeout", TYPE_INTEGER, cookie_timeout, {0}},
{NULL, "strict-ssl", TYPE_BOOLEAN, strict_ssl, {0}},
+ {NULL, "strict-focus", TYPE_BOOLEAN, strict_focus, {0}},
{NULL, "scrollstep", TYPE_INTEGER, scrollstep, {0}},
{NULL, "status-color-bg", TYPE_COLOR, status_color_bg, {0}},
return true;
}
+static gboolean strict_focus(const Setting *s, const SettingType type)
+{
+ if (type != SETTING_SET) {
+ if (type == SETTING_TOGGLE) {
+ vb.config.strict_focus = !vb.config.strict_focus;
+ }
+ print_value(s, &vb.config.strict_focus);
+ } else {
+ vb.config.strict_focus = s->arg.i ? true : false;
+ }
+
+ return true;
+}
+
static gboolean ca_bundle(const Setting *s, const SettingType type)
{
char *value;