diff --git a/WDL/IPlug/IGraphicsCocoa.h b/WDL/IPlug/IGraphicsCocoa.h index e6a66b3308..536c95adb3 100644 --- a/WDL/IPlug/IGraphicsCocoa.h +++ b/WDL/IPlug/IGraphicsCocoa.h @@ -74,6 +74,8 @@ NSString* ToNSString(const char* cStr); - (BOOL) acceptsFirstResponder; - (BOOL) acceptsFirstMouse: (NSEvent*) pEvent; - (void) viewDidMoveToWindow; +- (void) updateTrackingAreas; +- (void) mouseEntered:(NSEvent *) pEvent; - (void) drawRect: (NSRect) rect; - (void) onTimer: (NSTimer*) pTimer; - (void) getMouseXY: (NSEvent*) pEvent x: (int*) pX y: (int*) pY; diff --git a/WDL/IPlug/IGraphicsCocoa.mm b/WDL/IPlug/IGraphicsCocoa.mm index 0d749d28d5..f561bac0df 100644 --- a/WDL/IPlug/IGraphicsCocoa.mm +++ b/WDL/IPlug/IGraphicsCocoa.mm @@ -264,6 +264,31 @@ - (void) viewDidMoveToWindow } } +- (void) updateTrackingAreas +{ + [ super updateTrackingAreas]; + + NSTrackingArea *trackingArea; + + for (trackingArea in [[[self trackingAreas] copy] autorelease]) { + [self removeTrackingArea:trackingArea]; + } + + trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] + options:(NSTrackingMouseEnteredAndExited | + NSTrackingActiveAlways | + NSTrackingInVisibleRect) + owner:self + userInfo:nil]; + [self addTrackingArea:trackingArea]; +} + +- (void) mouseEntered:(NSEvent *) pEvent +{ + [super mouseEntered:pEvent]; + [[NSCursor arrowCursor] set]; +} + - (void) drawRect: (NSRect) rect { if (mGraphics)