mirror of
https://github.com/gnustep/libs-back.git
synced 2025-06-01 09:42:17 +00:00
Prevent generating mouseMoved events when the mouse hasn't moved
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29905 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9978707706
commit
c3cdc8ebba
2 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-03-11 Doug Simons <doug.simons@testplant.com>
|
||||||
|
|
||||||
|
* Source/win32/WIN32Server.m: Prevent generating spurious
|
||||||
|
NSMouseMoved events when the mouse hasn't actually moved.
|
||||||
|
|
||||||
2010-03-08 Doug Simons <doug.simons@testplant.com>
|
2010-03-08 Doug Simons <doug.simons@testplant.com>
|
||||||
|
|
||||||
* Source/win32/WIN32Server.m: Oops, I don't know how the
|
* Source/win32/WIN32Server.m: Oops, I don't know how the
|
||||||
|
|
|
@ -1974,6 +1974,16 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
|
||||||
if (eventType == NSRightMouseUp) rDown = NO;
|
if (eventType == NSRightMouseUp) rDown = NO;
|
||||||
if (eventType == NSOtherMouseUp) oDown = 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
|
event = [NSEvent mouseEventWithType: eventType
|
||||||
location: eventLocation
|
location: eventLocation
|
||||||
modifierFlags: eventFlags
|
modifierFlags: eventFlags
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue