Skip to content
Snippets Groups Projects
Commit 58cb57ac authored by George Nachman's avatar George Nachman
Browse files

Minor code cleanup

parent 1e3610f7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -20,6 +20,7 @@
// block is called on every element in order.
- (NSArray *)filteredArrayUsingBlock:(BOOL (^)(id anObject))block;
 
// Does the array contain at least one object not equal to @c anObject?
- (BOOL)containsObjectBesides:(id)anObject;
 
@end
Loading
Loading
Loading
Loading
@@ -7,7 +7,6 @@
//
 
#import "NSWorkspace+iTerm.h"
#import <CoreGraphics/CoreGraphics.h>
 
@implementation NSWorkspace (iTerm)
 
Loading
Loading
Loading
Loading
@@ -1253,6 +1253,7 @@ static iTermController *gSharedInstance;
}
}
 
// This exists because I don't trust -[NSApp keyWindow]. I've seen all kinds of weird behavior from it.
- (BOOL)anyOrderedWindowIsKey {
DLog(@"Searching for key window...");
for (NSWindow *window in [NSApp orderedWindows]) {
Loading
Loading
@@ -1265,7 +1266,6 @@ static iTermController *gSharedInstance;
return NO;
}
 
- (BOOL)keystrokesBeingStolen {
// If we're active and have ordered windows but none of them are key then our keystrokes are
// being stolen by something else. This is meant to detect when Spotlight is open. It might
Loading
Loading
@@ -1273,6 +1273,7 @@ static iTermController *gSharedInstance;
return [NSApp isActive] && [[NSApp orderedWindows] count] > 0 && ![self anyOrderedWindowIsKey];
}
 
// I don't trust -[NSApp mainWindow].
- (BOOL)anyWindowIsMain {
for (NSWindow *window in [[NSApplication sharedApplication] windows]) {
if ([window isMainWindow]) {
Loading
Loading
@@ -1291,6 +1292,7 @@ static iTermController *gSharedInstance;
return nil;
}
 
// Returns all terminal windows that are key.
- (NSArray<PTYWindow *> *)keyTerminalWindows {
NSMutableArray<PTYWindow *> *temp = [NSMutableArray array];
for (PseudoTerminal *term in [[iTermController sharedInstance] terminals]) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment