summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc4
-rw-r--r--webkit/tools/test_shell/webwidget_host_win.cc8
2 files changed, 9 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index 3701c5f..d0dc942 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -485,9 +485,7 @@ void TestShell::WaitTestFinished() {
}
void TestShell::InteractiveSetFocus(WebWidgetHost* host, bool enable) {
- if (enable)
- ::SetFocus(host->view_handle());
- else if (::GetFocus() == host->view_handle())
+ if (!enable && ::GetFocus() == host->view_handle())
::SetFocus(NULL);
}
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) {