BigZaphod / Chameleon

Chameleon is a port of Apple's UIKit for iOS (and some minimal related frameworks) to Mac OS X.
http://chameleonproject.org/
BSD 3-Clause "New" or "Revised" License
3.44k stars 569 forks source link

NSLeftMouseDown events ignored BUG - fix #72

Closed ivanandriollo closed 12 years ago

ivanandriollo commented 12 years ago

fix in UIApplication.m of the - (void)_sendMouseNSEvent:(NSEvent )theNSEvent fromScreen:(UIScreen )theScreen method BUG that ignores NSLeftMouseDown events in some situations

fixed bug that prevented NSLeftMouseDown and NSRightMouseDown from being fired in the - (void)_sendMouseNSEvent:(NSEvent )theNSEvent fromScreen:(UIScreen )theScreen method if a user generated a gesture event prior to clicking the mouse. This happens if a user using an Apple Magic Mouse swipes a finger over the surface as he is clicking the mouse. All MouseDown events are ignored until the finger is lifted from the surface. The swipe creates a case in which TouchIsActiveGesture(touch) returns YES for a click and prevents the correct if-else statement from executing thus the NSLeftMouseDown event gets ignored. With the fix we first check for a MouseDown event before calling TouchIsActiveGesture(touch) so we never ignore a MouseDown event, even if called at the same time as an inadvertent gesture.