diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 08:32:52 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 08:32:52 +0000 |
commit | 6fae8e0c8b1f8e17223b01debdfc8818dbbac250 (patch) | |
tree | 3f190dce66c506a7b41c75489179f877a5a3b5a8 | |
parent | 2563275f12646864039ee45d0878c771aa58da15 (diff) | |
download | chromium_src-6fae8e0c8b1f8e17223b01debdfc8818dbbac250.zip chromium_src-6fae8e0c8b1f8e17223b01debdfc8818dbbac250.tar.gz chromium_src-6fae8e0c8b1f8e17223b01debdfc8818dbbac250.tar.bz2 |
A quick fix for Issue 15971.
This is another my stupid mistake that my r19238 sends a Char event even when its text[] member does not contains any characters.
I mis-understoold I needed to send a Char event every time when gtk_keyval_to_unicode() returns 0 to avoid Issue 15024. But this is wrong.
(Page Down, Page Up, Arrow Keys work without Char events. Only return keys need Char events.)
BUG=15971 "drop down list moves 2 positions when using the keyboard".
TEST=Open the attached test-case
Review URL: http://codereview.chromium.org/155207
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20370 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_gtk.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 4fb20ba..e8ce708 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -135,15 +135,16 @@ class RenderWidgetHostViewGtkWidget { // 2. The given key event is not a control-key event but printable // characters aren't assigned to the event, (e.g. alt+d, etc.) // Create a Char event manually from this key event and send it to the - // renderer only when this event is a control-key event because - // control-key events should be processed by WebKit. + // renderer when this Char event contains a printable character which + // should be processed by WebKit. // TODO(hbono): Windows Chrome sends a Char event with its isSystemKey // value true for the above case 2. We should emulate this behavior? if (event->type == GDK_KEY_PRESS && !gdk_keyval_to_unicode(event->keyval)) { NativeWebKeyboardEvent wke(event); wke.type = WebKit::WebInputEvent::Char; - host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); + if (wke.text[0]) + host_view->GetRenderWidgetHost()->ForwardKeyboardEvent(wke); } } |