From 628f32ec30ac869b4c836609351faee4585f5d4c Mon Sep 17 00:00:00 2001 From: portix Date: Mon, 12 Sep 2011 18:26:47 +0200 Subject: In keys-view, blur element on value-changed --HG-- branch : develop --- src/html.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index 3c4b6027..507e8933 100644 --- a/src/html.c +++ b/src/html.c @@ -156,6 +156,11 @@ dwb_html_key_changed_cb(WebKitDOMElement *target, WebKitDOMEvent *e, gpointer da dwb_set_key(id, value); return true; } +static gboolean +dwb_html_key_really_changed_cb(WebKitDOMElement *target, WebKitDOMEvent *e, gpointer data) { + webkit_dom_element_blur(target); + return true; +} void dwb_html_keys_load_cb(WebKitWebView *wv, GParamSpec *p, HtmlTable *table) { KeyMap *km; @@ -173,7 +178,7 @@ dwb_html_keys_load_cb(WebKitWebView *wv, GParamSpec *p, HtmlTable *table) { mod = dwb_modmask_to_string(km->mod); value = g_strdup_printf("%s%s%s", mod, strlen(mod) > 0 ? " " : "", km->key ? km->key : ""); webkit_dom_html_input_element_set_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(input), value); - webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "change", G_CALLBACK(dwb_html_key_changed_cb), false, wv); + webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "change", G_CALLBACK(dwb_html_key_really_changed_cb), false, wv); webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "blur", G_CALLBACK(dwb_html_key_changed_cb), false, wv); webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "focus", G_CALLBACK(dwb_html_focus_cb), false, wv); FREE(mod); -- cgit v1.2.3