diff --git a/ChangeLog b/ChangeLog index 28fb6c1..8bc0a12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-03-11 Doug Simons + + * Source/win32/WIN32Server.m: Prevent generating spurious + NSMouseMoved events when the mouse hasn't actually moved. + 2010-03-08 Doug Simons * Source/win32/WIN32Server.m: Oops, I don't know how the diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index e8737dd..9b27916 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -1973,6 +1973,16 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam, if (eventType == NSLeftMouseUp) lDown = NO; if (eventType == NSRightMouseUp) rDown = NO; if (eventType == NSOtherMouseUp) oDown = NO; + + if (eventType == NSMouseMoved) { + static HWND lastHwnd = 0; + static NSPoint lastLocation = {0.0, 0.0}; + if (hwnd == lastHwnd && NSEqualPoints(eventLocation, lastLocation)) + return nil; // mouse hasn't actually moved -- don't generate another event + // record window and location of this event, to check next mouseMoved event against + lastHwnd = hwnd; + lastLocation = eventLocation; + } event = [NSEvent mouseEventWithType: eventType location: eventLocation