From: Kevin Ollivier Date: Tue, 3 Mar 2009 23:23:51 +0000 (+0000) Subject: More fixes for clickCount... even sometimes when respondsToSelector returned true... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/08c1b1340d318dfdbdec8bd2723925c2ec404386 More fixes for clickCount... even sometimes when respondsToSelector returned true we'd get a crash, so only check clickCount for up and down events. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 9b2cfd9b55..b5a0f099e5 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -265,8 +265,6 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) // these parameters are not given for all events UInt32 button = [nsEvent buttonNumber]; UInt32 clickCount = 0; - if ( [nsEvent respondsToSelector:@selector(clickCount:)] ) - [nsEvent clickCount]; wxevent.m_x = screenMouseLocation.x; wxevent.m_y = screenMouseLocation.y; @@ -274,7 +272,6 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) wxevent.m_controlDown = modifiers & NSControlKeyMask; wxevent.m_altDown = modifiers & NSAlternateKeyMask; wxevent.m_metaDown = modifiers & NSCommandKeyMask; - wxevent.m_clickCount = clickCount; wxevent.SetTimestamp( [nsEvent timestamp] * 1000.0 ) ; UInt32 mouseChord = 0; @@ -347,6 +344,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) case NSLeftMouseDown : case NSRightMouseDown : case NSOtherMouseDown : + clickCount = [nsEvent clickCount]; switch ( button ) { case 0 : @@ -369,6 +367,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) case NSLeftMouseUp : case NSRightMouseUp : case NSOtherMouseUp : + clickCount = [nsEvent clickCount]; switch ( button ) { case 0 : @@ -421,6 +420,9 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) default : break ; } + + wxevent.m_clickCount = clickCount; + } @implementation wxNSView