From feab536198e21e8f4777c3c8035a6ca6479f6912 Mon Sep 17 00:00:00 2001 From: "hbono@chromium.org" Date: Wed, 1 Jul 2009 04:41:53 +0000 Subject: A quick fix for Issue 15531 and 10953 This issue is caused by my another mistake that I forgot setting the modifier-key state in creating a Char event in RenderWidgetHostViewGtkWidget::ForwardCharEvent(). Since the GtkIMContext signal-handlers don't use GdkEventKey objects and cannot get the modififer-key state, this change save the state in RenderWidgetHostViewGtkWidget::KeyPressReleaseEvent() before dispatching a key event to the GtkIMContext object. Also, this change adds gtk_im_context_focus_in() and gtk_im_context_focus_out() calls to fix compatibility problems with ibus. BUG=10953 "IME support" BUG=15531 "regression: shift-space doesn't scroll the page backwards" TEST=Open a test page in , press shift+space keys, and observe ev.shiftKey is true. Review URL: http://codereview.chromium.org/151010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19707 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/native_web_keyboard_event.h | 4 +++- chrome/common/native_web_keyboard_event_linux.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'chrome/common') diff --git a/chrome/common/native_web_keyboard_event.h b/chrome/common/native_web_keyboard_event.h index 4c25979..021d061 100644 --- a/chrome/common/native_web_keyboard_event.h +++ b/chrome/common/native_web_keyboard_event.h @@ -31,7 +31,9 @@ struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { explicit NativeWebKeyboardEvent(NSEvent *event); #elif defined(OS_LINUX) explicit NativeWebKeyboardEvent(const GdkEventKey* event); - NativeWebKeyboardEvent(wchar_t character, double time_stamp_seconds); + NativeWebKeyboardEvent(wchar_t character, + int state, + double time_stamp_seconds); #endif NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); diff --git a/chrome/common/native_web_keyboard_event_linux.cc b/chrome/common/native_web_keyboard_event_linux.cc index 4ad74a3..6df2290 100644 --- a/chrome/common/native_web_keyboard_event_linux.cc +++ b/chrome/common/native_web_keyboard_event_linux.cc @@ -39,8 +39,10 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const GdkEventKey* native_event) } NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, + int state, double time_stamp_seconds) : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, + state, time_stamp_seconds)), os_event(NULL) { } -- cgit v1.1