MGR: One more efficiency tweak to my previous commit dcc0afa

This commit is contained in:
Charlie Fenton 2014-06-10 05:34:52 -07:00
parent d9ec92a014
commit 2f9f44aacf
1 changed files with 16 additions and 15 deletions

View File

@ -1059,23 +1059,24 @@ static BOOL AccessibilityEnabled = false;
//
static BOOL firstTime = true;
static BOOL haveMethod = false;
if (firstTime) {
IMP callStackSyms = class_getMethodImplementation(objc_getClass("NSThread"), @selector(callStackSymbols));
haveMethod = (callStackSyms != nil);
firstTime = false;
}
if (!haveMethod) {
return [super hitTest:aPoint];
}
NSRect r = [parent bounds];
r.size.height = [self bounds].size.height;
if (!NSPointInRect(aPoint, r)){
return [super hitTest:aPoint]; // Point is not within our rect
}
if (AccessibilityEnabled) {
if (firstTime) {
IMP callStackSyms = class_getMethodImplementation(objc_getClass("NSThread"), @selector(callStackSymbols));
haveMethod = (callStackSyms != nil);
firstTime = false;
}
if (!haveMethod) {
return [super hitTest:aPoint];
}
NSRect r = [parent bounds];
r.size.height = [self bounds].size.height;
if (!NSPointInRect(aPoint, r)){
return [super hitTest:aPoint]; // Point is not within our rect
}
// NSArray *theStack = [NSThread callStackSymbols];
NSArray *theStack = [ NSThread performSelector:@selector(callStackSymbols) ];