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

There's a hack to make the app active when the space changes to a lion...

There's a hack to make the app active when the space changes to a lion fullscreen window and the app isn't active. This is needed only for LSUIElement apps, where the OS gets confused. Limit the hack to LSUIElement mode since you could use spaces and have two monitors. Issue 5489.
parent 07a0dace
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1458,7 +1458,7 @@ ITERM_WEAKLY_REFERENCEABLE
 
- (void)activeSpaceDidChange:(NSNotification *)notification {
DLog(@"Active space did change. active=%@ self.window.isOnActiveSpace=%@", @(NSApp.isActive), @(self.window.isOnActiveSpace));
if (!NSApp.isActive && self.lionFullScreen && self.window.isOnActiveSpace) {
if ([(iTermApplication *)NSApp isUIElement] && !NSApp.isActive && self.lionFullScreen && self.window.isOnActiveSpace) {
DLog(@"Activating app because lion full screen window is on active space. %@", self);
[NSApp activateIgnoringOtherApps:YES];
}
Loading
Loading
Loading
Loading
@@ -48,6 +48,7 @@
// Sets the return value for -currentEvent. Only for testing.
@property(atomic, retain) NSEvent *fakeCurrentEvent;
@property(nonatomic, readonly) NSStatusItem *statusBarItem;
@property(nonatomic) BOOL isUIElement;
 
- (void)sendEvent:(NSEvent *)anEvent;
- (iTermApplicationDelegate<iTermApplicationDelegate> *)delegate;
Loading
Loading
@@ -55,7 +56,4 @@
// Like orderedWindows, but only iTermWindow/iTermPanel objects wrapped in iTermScriptingWindow*s are returned.
- (NSArray<iTermScriptingWindow *> *)orderedScriptingWindows;
 
// Changes the process type.
- (void)setIsUIElementApplication:(BOOL)uiElement;
@end
Loading
Loading
@@ -49,9 +49,7 @@
@property(nonatomic, retain) NSStatusItem *statusBarItem;
@end
 
@implementation iTermApplication {
BOOL _isUIElement;
}
@implementation iTermApplication
 
- (void)dealloc {
[_fakeCurrentEvent release];
Loading
Loading
@@ -358,7 +356,7 @@
}];
}
 
- (void)setIsUIElementApplication:(BOOL)uiElement {
- (void)setIsUIElement:(BOOL)uiElement {
if (uiElement == _isUIElement) {
return;
}
Loading
Loading
Loading
Loading
@@ -1938,7 +1938,7 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
#pragma mark - Private
 
- (void)updateProcessType {
[[iTermApplication sharedApplication] setIsUIElementApplication:[iTermPreferences boolForKey:kPreferenceKeyUIElement]];
[[iTermApplication sharedApplication] setIsUIElement:[iTermPreferences boolForKey:kPreferenceKeyUIElement]];
}
 
- (PseudoTerminal *)terminalToOpenFileIn {
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