From 96e116de9e2fb9e65b5acf82a1a6ccf2a0c7d6de Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 31 Jul 2015 14:45:31 -0400 Subject: [PATCH] Windows: Fix multiple handling of WM_MOUSEWHEEL messages (issue #1481) --- patch/patch.cfg | 6 ++++++ patch/patches/hwnd_message_handler_1481.patch | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 patch/patches/hwnd_message_handler_1481.patch diff --git a/patch/patch.cfg b/patch/patch.cfg index e0c3af032..49ab96d4b 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -176,4 +176,10 @@ patches = [ 'name': 'process_title_1639', 'path': '../content/common/', }, + { + # Fix multiple handling of WM_MOUSEWHEEL messages on Windows. + # https://bitbucket.org/chromiumembedded/cef/issues/1481 + 'name': 'hwnd_message_handler_1481', + 'path': '../ui/views/win/', + }, ] diff --git a/patch/patches/hwnd_message_handler_1481.patch b/patch/patches/hwnd_message_handler_1481.patch new file mode 100644 index 000000000..ed7096d86 --- /dev/null +++ b/patch/patches/hwnd_message_handler_1481.patch @@ -0,0 +1,19 @@ +diff --git hwnd_message_handler.cc hwnd_message_handler.cc +index bd2072b..c3fd2ea 100644 +--- hwnd_message_handler.cc ++++ hwnd_message_handler.cc +@@ -2649,8 +2649,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, + "440919 HWNDMessageHandler::HandleMouseEventInternal6")); + + // Reroute the mouse wheel to the window under the pointer if applicable. +- return (ui::RerouteMouseWheel(hwnd(), w_param, l_param) || +- delegate_->HandleMouseEvent(ui::MouseWheelEvent(msg))) ? 0 : 1; ++ if (ui::RerouteMouseWheel(hwnd(), w_param, l_param) || ++ delegate_->HandleMouseEvent(ui::MouseWheelEvent(msg))) { ++ SetMsgHandled(TRUE); ++ return 0; ++ } ++ return 1; + } + + // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.