diff options
| author | Neil <nyamatongwe@gmail.com> | 2014-11-19 13:07:41 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2014-11-19 13:07:41 +1100 |
| commit | e9852dc1ceb2756b10ec6ab6b2238346e883e115 (patch) | |
| tree | b467c95f417457595728a5c6fa3340c0b1495059 /win32/ScintillaWin.cxx | |
| parent | fb9e8bb503efc6c2b760b05bf2c1f67fa37fa7b5 (diff) | |
| download | scintilla-mirror-e9852dc1ceb2756b10ec6ab6b2238346e883e115.tar.gz | |
Bug [#1670]. Avoid processing mouse move events where the mouse has not moved
as these can cause unexpected dwell start notifications.
From Yusuf Ramazan Karagöz.
Diffstat (limited to 'win32/ScintillaWin.cxx')
| -rw-r--r-- | win32/ScintillaWin.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
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<long>(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<long>(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: |
