diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 03:48:01 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 03:48:01 +0000 |
commit | 9e8a226e75c01c40a5d1509010dd7c73c2c46668 (patch) | |
tree | f37373e92c247109602e380d44b6245ec9c5c037 | |
parent | 22e17689c4787d07f04e472383051088d4a3fca8 (diff) | |
download | chromium_src-9e8a226e75c01c40a5d1509010dd7c73c2c46668.zip chromium_src-9e8a226e75c01c40a5d1509010dd7c73c2c46668.tar.gz chromium_src-9e8a226e75c01c40a5d1509010dd7c73c2c46668.tar.bz2 |
Fix issue 20297: Typing backspace while in a form field causes the browser to go back in its history
With the changes made in CL http://codereview.chromium.org/173344, gtk_window_activate_key() is used to handle a key event that was not handled by webkit. Unlike the old code, gtk_window_activate_key() may match the key event with predefined accelerators according to its hardware_keycode rather than keyval. Thus, we need to set hardare_keycode to an invalid value in GtkIMContextWrapper if the key event is handled by IME, to prevent BrowserWindowGtk from handling it again.
BUG=20297: Typing backspace while in a form field causes the browser to go back in its history
TEST=Starts scim's XIM server by running "scim -d", then runs chrome with GTK_IM_MODULE=xim. Open www.google.com and press backspace in the search box, the browser shall not go back to previous page.
Review URL: http://codereview.chromium.org/179016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24719 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/gtk_im_context_wrapper.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc index 6381e9b..265c9f1 100644 --- a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc @@ -287,6 +287,7 @@ void GtkIMContextWrapper::ProcessFilteredKeyPressEvent( // Backspace key event, the browser may go back to previous page. if (wke->os_event) { wke->os_event->keyval = GDK_VoidSymbol; + wke->os_event->hardware_keycode = 0; wke->os_event->state = 0; } } |