X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/065e208ec09e3d08d51d9604497f92f53c210f93..54af24613f3a2f2d5c47b69923c67f660c61bd09:/src/cocoa/NSView.mm?ds=sidebyside diff --git a/src/cocoa/NSView.mm b/src/cocoa/NSView.mm index 7a4d133ff4..72c6899868 100644 --- a/src/cocoa/NSView.mm +++ b/src/cocoa/NSView.mm @@ -73,11 +73,21 @@ void wxCocoaNSView::DisassociateNSView(WX_NSView cocoaNSView) - (void)otherMouseDown:(NSEvent *)theEvent; - (void)otherMouseDragged:(NSEvent *)theEvent; - (void)otherMouseUp:(NSEvent *)theEvent; +- (void)resetCursorRects; @end // wxPoserNSView WX_IMPLEMENT_POSER(wxPoserNSView); @implementation wxPoserNSView : NSView +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent +{ + bool acceptsFirstMouse = false; + wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa(self); + if(!win || !win->Cocoa_acceptsFirstMouse(acceptsFirstMouse, theEvent)) + acceptsFirstMouse = [super acceptsFirstMouse:theEvent]; + return acceptsFirstMouse; +} + - (void)drawRect: (NSRect)rect { wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa(self); @@ -169,6 +179,13 @@ WX_IMPLEMENT_POSER(wxPoserNSView); [super otherMouseUp:theEvent]; } +- (void)resetCursorRects +{ + wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa(self); + if( !win || !win->Cocoa_resetCursorRects() ) + [super resetCursorRects]; +} + @end // implementation wxPoserNSView @interface wxNSViewNotificationObserver : NSObject