From 5007acf288a92f58c3d4a039a69b9baf50bed08b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 19 Nov 2014 13:07:41 +1100 Subject: =?UTF-8?q?Bug=20[#1670].=20Avoid=20processing=20mouse=20move=20ev?= =?UTF-8?q?ents=20where=20the=20mouse=20has=20not=20moved=20as=20these=20c?= =?UTF-8?q?an=20cause=20unexpected=20dwell=20start=20notifications.=20From?= =?UTF-8?q?=20Yusuf=20Ramazan=20Karag=C3=B6z.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- win32/ScintillaWin.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 132aea91a..237f8e17a 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1082,12 +1082,19 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam } break; - case WM_MOUSEMOVE: - SetTrackMouseLeaveEvent(true); - ButtonMoveWithModifiers(Point::FromLong(static_cast(lParam)), - ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) | - ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) | - (Platform::IsKeyDown(VK_MENU) ? SCI_ALT : 0)); + case WM_MOUSEMOVE: { + const Point pt = Point::FromLong(static_cast(lParam)); + + // Windows might send WM_MOUSEMOVE even though the mouse has not been moved: + // http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx + if (ptMouseLast.x != pt.x || ptMouseLast.y != pt.y) { + SetTrackMouseLeaveEvent(true); + ButtonMoveWithModifiers(pt, + ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) | + ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) | + (Platform::IsKeyDown(VK_MENU) ? SCI_ALT : 0)); + } + } break; case WM_MOUSELEAVE: -- cgit v1.2.3