summaryrefslogtreecommitdiff
path: root/area_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-15 20:42:29 -0400
committerPietro Gagliardi <[email protected]>2014-05-15 20:42:29 -0400
commit7645f459e7b346137898c132baf401adb71004ec (patch)
tree941aa2e52393e875f665c0f6d15fb5f95511461f /area_darwin.m
parent100a41e1c958c9ae688e5e0b34d8b97602c602c3 (diff)
Removed bleh_darwin.m's tracking area logic and rewrote it in Objective-C in area_darwin.m.
Diffstat (limited to 'area_darwin.m')
-rw-r--r--area_darwin.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/area_darwin.m b/area_darwin.m
index 041841d..f283b5e 100644
--- a/area_darwin.m
+++ b/area_darwin.m
@@ -55,7 +55,12 @@
- (void)retrack
{
- trackingArea = makeTrackingArea(self); // TODO make inline
+ trackingArea = [[NSTrackingArea alloc]
+ initWithRect:[self bounds]
+ // this bit mask (except for NSTrackingInVisibleRect, which was added later to prevent events from being triggered outside the visible area of the Area) comes from https://github.com/andlabs/misctestprogs/blob/master/cocoaviewmousetest.m (and I wrote this bit mask on 25 april 2014) and yes I know it includes enter/exit even though we don't watch those events; it probably won't really matter anyway but if it does I can change it easily
+ options:(NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingActiveAlways | NSTrackingEnabledDuringMouseDrag | NSTrackingInVisibleRect)
+ owner:self
+ userInfo:nil];
[self addTrackingArea:trackingArea];
}