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 | 5007acf288a92f58c3d4a039a69b9baf50bed08b (patch) | |
tree | bca41bdbe36b0e5d330e2a01d15f9bd1e1e42f1e | |
parent | 44fd19fb024c20194865c4fb49806fe060350f3e (diff) | |
download | scintilla-mirror-5007acf288a92f58c3d4a039a69b9baf50bed08b.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.
-rw-r--r-- | doc/ScintillaHistory.html | 6 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 19 |
2 files changed, 19 insertions, 6 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 5be8e6b89..d1e449fc0 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -462,6 +462,7 @@ <td>Baurzhan Muftakhidinov</td> </tr><tr> <td>Erik Angelin</td> + <td>Yusuf Ramazan Karagöz</td> </tr> </table> <p> @@ -515,6 +516,11 @@ <a href="http://sourceforge.net/p/scintilla/bugs/1643/">Bug #1643</a>. </li> <li> + On Windows, avoid processing mouse move events where the mouse has not moved as these can + cause unexpected dwell start notifications. + <a href="http://sourceforge.net/p/scintilla/bugs/1670/">Bug #1670</a>. + </li> + <li> For GTK+ on Windows, avoid extra space when pasting from external application. </li> <li> 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: |