Commit 673a0c42 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Hack in order to fix crbug.com/394672 in M38

This CL effectively reverts https://codereview.chromium.org/344793013 for
Windows only.

BUG=394672
TEST=Manual, see bug

Review URL: https://codereview.chromium.org/446673004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288007 0039d316-1c4b-4281-b951-d872f2087c98
parent 70c9a5a0
...@@ -388,6 +388,9 @@ void WindowEventDispatcher::UpdateCapture(Window* old_capture, ...@@ -388,6 +388,9 @@ void WindowEventDispatcher::UpdateCapture(Window* old_capture,
} }
void WindowEventDispatcher::OnOtherRootGotCapture() { void WindowEventDispatcher::OnOtherRootGotCapture() {
// Sending the mouse exit causes bugs on Windows (e.g. crbug.com/394672).
// TODO(pkotwicz): Fix the bugs and send mouse exit on Windows too.
#if !defined(OS_WIN)
if (mouse_moved_handler_) { if (mouse_moved_handler_) {
// Dispatch a mouse exit to reset any state associated with hover. This is // Dispatch a mouse exit to reset any state associated with hover. This is
// important when going from no window having capture to a window having // important when going from no window having capture to a window having
...@@ -397,6 +400,7 @@ void WindowEventDispatcher::OnOtherRootGotCapture() { ...@@ -397,6 +400,7 @@ void WindowEventDispatcher::OnOtherRootGotCapture() {
if (details.dispatcher_destroyed) if (details.dispatcher_destroyed)
return; return;
} }
#endif
mouse_moved_handler_ = NULL; mouse_moved_handler_ = NULL;
mouse_pressed_handler_ = NULL; mouse_pressed_handler_ = NULL;
......
...@@ -947,10 +947,10 @@ TEST_F(WidgetCaptureTest, FailedCaptureRequestIsNoop) { ...@@ -947,10 +947,10 @@ TEST_F(WidgetCaptureTest, FailedCaptureRequestIsNoop) {
EXPECT_TRUE(mouse_view2->pressed()); EXPECT_TRUE(mouse_view2->pressed());
} }
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) && !defined(OS_WIN)
// Test that a synthetic mouse exit is sent to the widget which was handling // Test that a synthetic mouse exit is sent to the widget which was handling
// mouse events when a different widget grabs capture. // mouse events when a different widget grabs capture.
// TODO(pkotwicz): Make test pass on CrOS. // TODO(pkotwicz): Make test pass on CrOS and Windows.
TEST_F(WidgetCaptureTest, MouseExitOnCaptureGrab) { TEST_F(WidgetCaptureTest, MouseExitOnCaptureGrab) {
Widget widget1; Widget widget1;
Widget::InitParams params1 = Widget::InitParams params1 =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment