diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 19:31:21 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 19:31:21 +0000 |
commit | 46057f746c812d94747985e4210dec9f1fb1ee1d (patch) | |
tree | 8fafe2c371dc370a7b965a61c7f55f2485f3c5ae /webkit/tools/test_shell/webwidget_host_win.cc | |
parent | 15123f1788581598067683b3c1d6d88533e0a9bf (diff) | |
download | chromium_src-46057f746c812d94747985e4210dec9f1fb1ee1d.zip chromium_src-46057f746c812d94747985e4210dec9f1fb1ee1d.tar.gz chromium_src-46057f746c812d94747985e4210dec9f1fb1ee1d.tar.bz2 |
Make the focus handling in test_shell a bit closer to how
Chrome handles focus. Fixes a few issues where the page would
not correctly get focus (e.g. a page that alerts on a keydown
handler would never get focus again).
Review URL: http://codereview.chromium.org/18009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7952 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/webwidget_host_win.cc')
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index 3f56002..c282699 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -285,6 +285,14 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { break; } webwidget_->HandleInputEvent(&event); + + if (event.type == WebInputEvent::MOUSE_DOWN) { + // This mimics a temporary workaround in RenderWidgetHostViewWin + // for bug 765011 to get focus when the mouse is clicked. This + // happens after the mouse down event is sent to the renderer + // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN. + ::SetFocus(view_); + } } void WebWidgetHost::WheelEvent(WPARAM wparam, LPARAM lparam) { |