diff options
author | Tomas Popela <tpopela@redhat.com> | 2013-03-28 20:03:09 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2013-03-28 20:03:09 +0800 |
commit | 8c2472645ff9495eb98ca10217a3cfd19c991888 (patch) | |
tree | fe9bd95c1531b3a7f5db5e32495c00b70525188f /mail | |
parent | 4c5e629f518fa03610e69c970337d9f7d625a50b (diff) | |
download | gsoc2013-evolution-8c2472645ff9495eb98ca10217a3cfd19c991888.tar.gz gsoc2013-evolution-8c2472645ff9495eb98ca10217a3cfd19c991888.tar.zst gsoc2013-evolution-8c2472645ff9495eb98ca10217a3cfd19c991888.zip |
Fix for typing in ITIP comments when some keys triggered actions.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-reader.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 69bb388d72..1556481d62 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2612,6 +2612,33 @@ mail_reader_key_press_event_cb (EMailReader *reader, GtkAction *action; const gchar *action_name; + if (!gtk_widget_has_focus (GTK_WIDGET (reader))) { + WebKitWebFrame *frame; + WebKitDOMDocument *dom; + WebKitDOMElement *element; + EMailDisplay *display; + gchar *name = NULL; + + display = e_mail_reader_get_mail_display (reader); + frame = webkit_web_view_get_focused_frame (WEBKIT_WEB_VIEW (display)); + + if (frame) { + dom = webkit_web_frame_get_dom_document (frame); + /* intentionally used "static_cast" */ + element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument*) dom); + + if (element) + name = webkit_dom_node_get_node_name (WEBKIT_DOM_NODE (element)); + + /* if INPUT or TEXTAREA has focus, then any key press should go there */ + if (name && (g_ascii_strcasecmp (name, "INPUT") == 0 || g_ascii_strcasecmp (name, "TEXTAREA") == 0)) { + g_free (name); + return FALSE; + } + g_free (name); + } + } + if ((event->state & GDK_CONTROL_MASK) != 0) goto ctrl; |