From 9e8a226e75c01c40a5d1509010dd7c73c2c46668 Mon Sep 17 00:00:00 2001 From: "suzhe@chromium.org" Date: Fri, 28 Aug 2009 03:48:01 +0000 Subject: 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 --- chrome/browser/renderer_host/gtk_im_context_wrapper.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'chrome') 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; } } -- cgit v1.1