From 073480a615d644f8c61e339a500243db00989a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=BCng?= Date: Tue, 27 Sep 2016 10:03:48 +1000 Subject: On Win32, mouse wheel scrolling can be restricted to only occur when the mouse is within the window. --- win32/ScintillaWin.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 10d119b5a..3de78d1d4 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1272,6 +1272,18 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam break; case WM_MOUSEWHEEL: + if (!mouseWheelCaptures) { + // if the mouse wheel is not captured, test if the mouse + // pointer is over the editor window and if not, don't + // handle the message but pass it on. + RECT rc; + GetWindowRect(MainHWND(), &rc); + POINT pt; + pt.x = GET_X_LPARAM(lParam); + pt.y = GET_Y_LPARAM(lParam); + if (!PtInRect(&rc, pt)) + return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); + } // if autocomplete list active then send mousewheel message to it if (ac.Active()) { HWND hWnd = static_cast(ac.lb->GetID()); -- cgit v1.2.3