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

Make hotkey window into a floating panel. It appears over Lion fullscreen...

Make hotkey window into a floating panel. It appears over Lion fullscreen windows, but sometimes it gets into a mode where it doesn't get key status and I can't reproduce it consistently or get it out of that mode once it's in it.
parent b78ea992
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -47,7 +47,9 @@ static void RollInHotkeyTerm(PseudoTerminal* term)
{
HKWLog(@"Roll in [show] hotkey window");
 
[NSApp activateIgnoringOtherApps:YES];
if (![[PreferencePanel sharedInstance] hotkeyTogglesWindow]) {
[NSApp activateIgnoringOtherApps:YES];
}
[[term window] makeKeyAndOrderFront:nil];
[[NSAnimationContext currentContext] setDuration:[[PreferencePanel sharedInstance] hotkeyTermAnimationDuration]];
[[[term window] animator] setAlphaValue:1];
Loading
Loading
@@ -178,6 +180,7 @@ static void RollOutHotkeyTerm(PseudoTerminal* term, BOOL itermWasActiveWhenHotke
[[iTermController sharedInstance] storePreviouslyActiveApp];
itermWasActiveWhenHotkeyOpened_ = [NSApp isActive];
PseudoTerminal* hotkeyTerm = GetHotkeyWindow();
PreferencePanel* prefPanel = [PreferencePanel sharedInstance];
if (hotkeyTerm) {
HKWLog(@"Showing existing hotkey window");
int i = 0;
Loading
Loading
@@ -191,7 +194,9 @@ static void RollOutHotkeyTerm(PseudoTerminal* term, BOOL itermWasActiveWhenHotke
i++;
}
HKWLog(@"Activate iterm2");
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
if (![prefPanel hotkeyTogglesWindow]) {
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
rollingIn_ = YES;
RollInHotkeyTerm(hotkeyTerm);
} else {
Loading
Loading
Loading
Loading
@@ -42,7 +42,7 @@
- (void)_setContentHasShadow:(BOOL)shadow;
@end
 
@interface PTYWindow : NSWindow
@interface PTYWindow : NSPanel
 
- initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)aStyle
Loading
Loading
Loading
Loading
@@ -489,6 +489,9 @@ NSString *kSessionsKVCKey = @"sessions";
 
DLog(@"initWithContentRect:%@ styleMask:%d", [NSValue valueWithRect:initialFrame], (int)styleMask);
PTYWindow *myWindow;
if (isHotkey) {
styleMask |= NSNonactivatingPanelMask;
}
myWindow = [[PTYWindow alloc] initWithContentRect:initialFrame
styleMask:styleMask
backing:NSBackingStoreBuffered
Loading
Loading
@@ -607,7 +610,8 @@ NSString *kSessionsKVCKey = @"sessions";
 
if (isHotkey) {
// This allows the hotkey window to be in the same space as a Lion fullscreen iTerm2 window.
[[self window] setCollectionBehavior:[[self window] collectionBehavior] | NSWindowCollectionBehaviorFullScreenAuxiliary];
self.window.collectionBehavior = NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorFullScreenAuxiliary;
self.window.level = NSFloatingWindowLevel;
} else {
// This allows the window to enter Lion fullscreen.
[[self window] setCollectionBehavior:[[self window] collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
Loading
Loading
Loading
Loading
@@ -482,8 +482,8 @@ static BOOL hasBecomeActive = NO;
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)app
{
NSArray *terminals = [[iTermController sharedInstance] terminals];
if (terminals.count == 1 && [terminals[0] isHotKeyWindow]) {
// The last window wasn't really closed, it was just the hotkey window getting ordered out.
if (terminals.count > 0) {
// The OS doesn't count panels as windows, and the hotkey window is a panel.
return NO;
}
if (!userHasInteractedWithAnySession_) {
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