only send events to AtomWindows. Fixes #16.

This commit is contained in:
Corey Johnson
2011-09-09 15:05:19 -07:00
parent bc616d05e7
commit db0286f391

View File

@@ -9,11 +9,18 @@
case NSKeyDown:
case NSFlagsChanged:
{
AtomWindowController *controller = (AtomWindowController *)[[self keyWindow] windowController];
BOOL handeled = [controller handleKeyEvent:event];
BOOL handeled = NO;
id controller = [[self keyWindow] windowController];
// The keyWindow could be a Cocoa Dialog or something, ignore them.
if ([controller isKindOfClass:[AtomWindowController class]]) {
handeled = [controller handleKeyEvent:event];
}
if (!handeled) {
[super sendEvent:event];
}
}
break;
default: