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

Merge branch 'lion_restore' of github.com:gnachman/iTerm2 into lion_restore

parents 2f6f0cfe 659943aa
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,3 +16,8 @@
- (NSArray *)futureTouchesMatchingPhase:(int)phase inView:(NSView *)view;
@end
 
@interface NSWindow (Future)
- (void)futureSetRestorable:(BOOL)value;
- (void)futureSetRestorationClass:(Class)class;
- (void)futureInvalidateRestorableState;
@end
\ No newline at end of file
Loading
Loading
@@ -8,6 +8,35 @@
 
#import "FutureMethods.h"
 
@implementation NSWindow (Future)
- (void)futureSetRestorable:(BOOL)value
{
if ([self respondsToSelector:@selector(setRestorable:)]) {
NSMethodSignature *sig = [[self class] instanceMethodSignatureForSelector:@selector(setRestorable:)];
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig];
[inv setTarget:self];
[inv setSelector:@selector(setRestorable:)];
[inv setArgument:&value atIndex:2];
[inv invoke];
}
}
- (void)futureSetRestorationClass:(Class)class
{
if ([self respondsToSelector:@selector(futureSetRestorationClass:)]) {
[self performSelector:@selector(setRestorationClass:) withObject:class];
}
}
- (void)futureInvalidateRestorableState
{
if ([self respondsToSelector:@selector(invalidateRestorableState)]) {
[self performSelector:@selector(invalidateRestorableState)];
}
}
@end
@implementation NSView (Future)
- (void)futureSetAcceptsTouchEvents:(BOOL)value
{
Loading
Loading
@@ -47,9 +76,9 @@
[inv invoke];
NSArray *result;
[inv getReturnValue:&result];
return result;
return result;
} else {
return [NSArray array];
}
return [NSArray array];
}
}
@end
Loading
Loading
@@ -241,6 +241,9 @@ NSWindowDelegate,
IBOutlet NSPanel *coprocesssPanel_;
IBOutlet NSButton *coprocessOkButton_;
IBOutlet NSTextField *coprocessCommand_;
NSDictionary *lastArrangement_;
BOOL wellFormed_;
}
 
+ (void)drawArrangementPreview:(NSDictionary*)terminalArrangement
Loading
Loading
@@ -321,6 +324,8 @@ NSWindowDelegate,
- (IBAction)openSplitVerticallySheet:(id)sender;
- (IBAction)findCursor:(id)sender;
 
- (void)futureInvalidateRestorableState;
// Close the active session.
- (IBAction)closeCurrentSession:(id)sender;
- (void)closeSessionWithConfirmation:(PTYSession *)aSession;
Loading
Loading
@@ -674,7 +679,9 @@ NSWindowDelegate,
// Return the smallest allowable width for this terminal.
- (float)minWidth;
 
+ (PseudoTerminal*)bareTerminalWithArrangement:(NSDictionary*)arrangement;
+ (PseudoTerminal*)terminalWithArrangement:(NSDictionary*)arrangement;
- (void)loadArrangement:(NSDictionary *)arrangement;
- (NSDictionary*)arrangement;
 
- (void)appendTab:(PTYTab*)theTab;
Loading
Loading
Loading
Loading
@@ -449,6 +449,7 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
[SCREEN resizeWidth:width height:height];
[SHELL setWidth:width height:height];
[TEXTVIEW clearHighlights];
[[tab_ realParentWindow] futureInvalidateRestorableState];
}
 
- (void)setSplitSelectionMode:(SplitSelectionMode)mode
Loading
Loading
@@ -2015,6 +2016,7 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
horizontalSpacing:[[aDict objectForKey:KEY_HORIZONTAL_SPACING] floatValue]
verticalSpacing:[[aDict objectForKey:KEY_VERTICAL_SPACING] floatValue]];
[SCREEN setSaveToScrollbackInAlternateScreen:[aDict objectForKey:KEY_SCROLLBACK_IN_ALTERNATE_SCREEN] ? [[aDict objectForKey:KEY_SCROLLBACK_IN_ALTERNATE_SCREEN] boolValue] : YES];
[[tab_ realParentWindow] futureInvalidateRestorableState];
}
 
// Contextual menu
Loading
Loading
@@ -2674,6 +2676,7 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
}
[addressBookEntry release];
addressBookEntry = [dict retain];
[[tab_ realParentWindow] futureInvalidateRestorableState];
}
 
- (NSDictionary *)addressBookEntry
Loading
Loading
Loading
Loading
@@ -147,6 +147,7 @@ static const BOOL USE_THIN_SPLITTERS = YES;
- (void)numberOfSessionsDidChange
{
[self updatePaneTitles];
[realParentWindow_ futureInvalidateRestorableState];
}
 
- (void)appendSessionViewToViewOrder:(SessionView*)sessionView
Loading
Loading
@@ -362,6 +363,7 @@ static const BOOL USE_THIN_SPLITTERS = YES;
}
 
--preserveOrder_;
[realParentWindow_ futureInvalidateRestorableState];
}
 
- (void)setActiveSession:(PTYSession*)session
Loading
Loading
@@ -1961,6 +1963,7 @@ static NSString* FormatRect(NSRect r) {
[temp release];
 
[[root_ window] makeFirstResponder:[activeSession_ TEXTVIEW]];
[realParentWindow_ futureInvalidateRestorableState];
}
 
- (void)unmaximize
Loading
Loading
@@ -1993,6 +1996,7 @@ static NSString* FormatRect(NSRect r) {
isMaximized_ = NO;
 
[[root_ window] makeFirstResponder:[activeSession_ TEXTVIEW]];
[realParentWindow_ futureInvalidateRestorableState];
}
 
- (BOOL)promptOnClose
Loading
Loading
Loading
Loading
@@ -963,11 +963,7 @@ static void reapchild(int n)
 
pid_t ppid = taskAllInfo.pbsd.pbi_ppid;
if (ppid == parentPid) {
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5
long long birthday = taskAllInfo.pbsd.pbi_start.tv_sec * 1000000 + taskAllInfo.pbsd.pbi_start.tv_usec;
#else
long long birthday = taskAllInfo.pbsd.pbi_start_tvsec * 1000000 + taskAllInfo.pbsd.pbi_start_tvusec; // 10.6 and up
#endif
if (birthday < oldestTime || oldestTime == 0) {
oldestTime = birthday;
oldestPid = pids[i];
Loading
Loading
Loading
Loading
@@ -891,13 +891,6 @@ NSMutableArray* screens=0;
[[self superview] setFrameSize:frameSize];
}
 
static BOOL RectsEqual(NSRect* a, NSRect* b) {
return a->origin.x == b->origin.x &&
a->origin.y == b->origin.y &&
a->size.width == b->size.width &&
a->size.height == b->size.height;
}
- (void)scheduleSelectionScroll
{
if (selectionScrollTimer) {
Loading
Loading
@@ -2813,7 +2806,7 @@ static BOOL RectsEqual(NSRect* a, NSRect* b) {
 
DebugLog([NSString stringWithFormat:@"Mouse down. startx=%d starty=%d, endx=%d, endy=%d", startX, startY, endX, endY]);
if([_delegate respondsToSelector: @selector(willHandleEvent:)] && [_delegate willHandleEvent: event])
[_delegate handleEvent: event];
[_delegate handleEvent:event];
[[[self dataSource] session] refreshAndStartTimerIfNeeded];
 
return NO;
Loading
Loading
Loading
Loading
@@ -70,6 +70,8 @@
#import "ProcessCache.h"
#import "MovePaneController.h"
#import "ToolbeltView.h"
#import "FutureMethods.h"
#import "PseudoTerminalRestorer.h"
 
#define CACHED_WINDOW_POSITIONS 100
 
Loading
Loading
@@ -482,7 +484,8 @@ NSString *sessionsKey = @"sessions";
toolbelt_ = [[[ToolbeltView alloc] initWithFrame:toolbeltFrame
term:self] autorelease];
[drawer_ setContentView:toolbelt_];
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
if ([itad showToolbelt]) {
[drawer_ open];
}
} else {
Loading
Loading
@@ -499,13 +502,18 @@ NSString *sessionsKey = @"sessions";
relativeTo:TABVIEW];
}
 
wellFormed_ = YES;
[[self window] futureSetRestorable:YES];
[[self window] futureSetRestorationClass:[PseudoTerminalRestorer class]];
NSLog(@"init window of size %@", [NSValue valueWithSize:self.window.frame.size]);
return self;
}
 
- (CGFloat)tabviewWidth
{
if ([self anyFullScreen]) {
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
if ([itad showToolbelt]) {
const CGFloat width = [self fullscreenToolbeltWidth];
return self.window.frame.size.width - width;
} else {
Loading
Loading
@@ -525,8 +533,9 @@ NSString *sessionsKey = @"sessions";
 
- (void)_updateDrawerVisibility:(id)sender
{
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
if (windowType_ != WINDOW_TYPE_NORMAL) {
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
if ([itad showToolbelt]) {
[toolbelt_ setHidden:NO];
} else {
[toolbelt_ setHidden:YES];
Loading
Loading
@@ -536,7 +545,7 @@ NSString *sessionsKey = @"sessions";
}
[self repositionWidgets];
} else {
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
if ([itad showToolbelt]) {
[drawer_ open];
} else {
[drawer_ close];
Loading
Loading
@@ -961,6 +970,7 @@ NSString *sessionsKey = @"sessions";
 
- (void)dealloc
{
wellFormed_ = NO;
[toolbelt_ shutdown];
[drawer_ release];
 
Loading
Loading
@@ -999,6 +1009,7 @@ NSString *sessionsKey = @"sessions";
if (fullScreenTabviewTimer_) {
[fullScreenTabviewTimer_ invalidate];
}
[lastArrangement_ release];
[super dealloc];
}
 
Loading
Loading
@@ -1219,17 +1230,16 @@ NSString *sessionsKey = @"sessions";
rect.size.height - 11)];
}
 
+ (PseudoTerminal*)terminalWithArrangement:(NSDictionary*)arrangement
+ (PseudoTerminal*)bareTerminalWithArrangement:(NSDictionary*)arrangement
{
PseudoTerminal* term;
int windowType = [PseudoTerminal _windowTypeForArrangement:arrangement];
int screenIndex = [PseudoTerminal _screenIndexForArrangement:arrangement];
NSRect normalWindowRect = NSZeroRect;
if (windowType == WINDOW_TYPE_FULL_SCREEN) {
term = [[[PseudoTerminal alloc] initWithSmartLayout:NO
windowType:WINDOW_TYPE_FORCE_FULL_SCREEN
screen:screenIndex] autorelease];
NSRect rect;
rect.origin.x = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_OLD_X_ORIGIN] doubleValue];
rect.origin.y = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_OLD_Y_ORIGIN] doubleValue];
Loading
Loading
@@ -1250,7 +1260,7 @@ NSString *sessionsKey = @"sessions";
}
// TODO: this looks like a bug - are top-of-screen windows not restored to the right screen?
term = [[[PseudoTerminal alloc] initWithSmartLayout:NO windowType:windowType screen:-1] autorelease];
NSRect rect;
rect.origin.x = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_X_ORIGIN] doubleValue];
rect.origin.y = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_Y_ORIGIN] doubleValue];
Loading
Loading
@@ -1258,27 +1268,46 @@ NSString *sessionsKey = @"sessions";
rect.size.width = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_WIDTH] doubleValue];
rect.size.height = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_HEIGHT] doubleValue];
[[term window] setFrame:rect display:NO];
normalWindowRect = rect;
}
NSLog(@"bare term has rect %@", [NSValue valueWithRect:term.window.frame]);
return term;
}
+ (PseudoTerminal*)terminalWithArrangement:(NSDictionary*)arrangement
{
PseudoTerminal* term = [PseudoTerminal bareTerminalWithArrangement:arrangement];
[term loadArrangement:arrangement];
return term;
}
- (void)loadArrangement:(NSDictionary *)arrangement
{
for (NSDictionary* tabArrangement in [arrangement objectForKey:TERMINAL_ARRANGEMENT_TABS]) {
[PTYTab openTabWithArrangement:tabArrangement inTerminal:term];
[PTYTab openTabWithArrangement:tabArrangement inTerminal:self];
}
int windowType = [PseudoTerminal _windowTypeForArrangement:arrangement];
if (windowType == WINDOW_TYPE_NORMAL) {
// The window may have changed size while adding tab bars, etc.
[[term window] setFrame:normalWindowRect display:YES];
NSRect rect;
rect.origin.x = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_X_ORIGIN] doubleValue];
rect.origin.y = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_Y_ORIGIN] doubleValue];
// TODO: for window type top, set width to screen width.
rect.size.width = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_WIDTH] doubleValue];
rect.size.height = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_HEIGHT] doubleValue];
[[self window] setFrame:rect display:YES];
}
 
[term->TABVIEW selectTabViewItemAtIndex:[[arrangement objectForKey:TERMINAL_ARRANGEMENT_SELECTED_TAB_INDEX] intValue]];
[TABVIEW selectTabViewItemAtIndex:[[arrangement objectForKey:TERMINAL_ARRANGEMENT_SELECTED_TAB_INDEX] intValue]];
 
Bookmark* addressbookEntry = [[[[[term tabs] objectAtIndex:0] sessions] objectAtIndex:0] addressBookEntry];
Bookmark* addressbookEntry = [[[[[self tabs] objectAtIndex:0] sessions] objectAtIndex:0] addressBookEntry];
if ([addressbookEntry objectForKey:KEY_SPACE] &&
[[addressbookEntry objectForKey:KEY_SPACE] intValue] == -1) {
[[term window] setCollectionBehavior:[[term window] collectionBehavior] | NSWindowCollectionBehaviorCanJoinAllSpaces];
[[self window] setCollectionBehavior:[[self window] collectionBehavior] | NSWindowCollectionBehaviorCanJoinAllSpaces];
}
 
[term fitTabsToWindow];
return term;
[self fitTabsToWindow];
}
 
- (NSDictionary*)arrangement
Loading
Loading
@@ -1471,9 +1500,10 @@ NSString *sessionsKey = @"sessions";
__FILE__, __LINE__, aNotification);
 
[[iTermController sharedInstance] setCurrentTerminal:self];
[[[NSApplication sharedApplication] delegate] updateMaximizePaneMenuItem];
[[[NSApplication sharedApplication] delegate] updateUseTransparencyMenuItem];
[[[NSApplication sharedApplication] delegate] updateBroadcastMenuState];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[itad updateMaximizePaneMenuItem];
[itad updateUseTransparencyMenuItem];
[itad updateBroadcastMenuState];
if (_fullScreen && [[self window] alphaValue] > 0) {
// Is a fullscreen window and is not a hidden hotkey window.
[self hideMenuBar];
Loading
Loading
@@ -1760,6 +1790,11 @@ NSString *sessionsKey = @"sessions";
return proposedFrameSize;
}
 
- (void)futureInvalidateRestorableState
{
[[self window] futureInvalidateRestorableState];
}
- (void)windowDidResize:(NSNotification *)aNotification
{
lastResizeTime_ = [[NSDate date] timeIntervalSince1970];
Loading
Loading
@@ -1791,6 +1826,7 @@ NSString *sessionsKey = @"sessions";
[[NSNotificationCenter defaultCenter] postNotificationName:@"iTermWindowDidResize"
object:self
userInfo:nil];
[self futureInvalidateRestorableState];
}
 
// PTYWindowDelegateProtocol
Loading
Loading
@@ -1807,7 +1843,8 @@ NSString *sessionsKey = @"sessions";
- (IBAction)toggleUseTransparency:(id)sender
{
useTransparency_ = !useTransparency_;
[[[NSApplication sharedApplication] delegate] updateUseTransparencyMenuItem];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[itad updateUseTransparencyMenuItem];
for (PTYSession* aSession in [self sessions]) {
[[aSession view] setNeedsDisplay:YES];
}
Loading
Loading
@@ -1968,7 +2005,8 @@ NSString *sessionsKey = @"sessions";
[newTerminal fitTabsToWindow];
[newTerminal hideMenuBar];
 
[newTerminal->toolbelt_ setHidden:![[[iTermApplication sharedApplication] delegate] showToolbelt]];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[newTerminal->toolbelt_ setHidden:![itad showToolbelt]];
// The toolbelt may try to become the first responder.
[[newTerminal window] makeFirstResponder:[[newTerminal currentSession] TEXTVIEW]];
}
Loading
Loading
@@ -2059,6 +2097,7 @@ NSString *sessionsKey = @"sessions";
lionFullScreen_ = YES;
// Set scrollbars appropriately
[self fitTabsToWindow];
[self futureInvalidateRestorableState];
}
 
- (void)windowWillExitFullScreen:(NSNotification *)notification
Loading
Loading
@@ -2074,6 +2113,7 @@ NSString *sessionsKey = @"sessions";
// Set scrollbars appropriately
[self fitTabsToWindow];
[self repositionWidgets];
[self futureInvalidateRestorableState];
}
 
- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender defaultFrame:(NSRect)defaultFrame
Loading
Loading
@@ -2575,6 +2615,7 @@ NSString *sessionsKey = @"sessions";
[self _updateTabObjectCounts];
 
[[NSNotificationCenter defaultCenter] postNotificationName: @"iTermNumberOfSessionsDidChange" object: self userInfo: nil];
[self futureInvalidateRestorableState];
}
 
- (NSMenu *)tabView:(NSTabView *)tabView menuForTabViewItem:(NSTabViewItem *)tabViewItem
Loading
Loading
@@ -2654,7 +2695,7 @@ NSString *sessionsKey = @"sessions";
PTYTab *theTab = [[PTYTab alloc] initWithSession:session];
[theTab setActiveSession:session];
[theTab setParentWindow:self];
NSTabViewItem *tabViewItem = [[[NSTabViewItem alloc] initWithIdentifier:theTab] autorelease];
NSTabViewItem *tabViewItem = [[[NSTabViewItem alloc] initWithIdentifier:(id)theTab] autorelease];
[theTab setTabViewItem:tabViewItem];
[tabViewItem setLabel:[session name] ? [session name] : @""];
 
Loading
Loading
@@ -3576,7 +3617,8 @@ NSString *sessionsKey = @"sessions";
}
[[aSession view] setNeedsDisplay:YES];
}
[[[NSApplication sharedApplication] delegate] updateBroadcastMenuState];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[itad updateBroadcastMenuState];
}
 
- (void)toggleBroadcastingInputToSession:(PTYSession *)session
Loading
Loading
@@ -3636,7 +3678,8 @@ NSString *sessionsKey = @"sessions";
[[aSession view] setNeedsDisplay:YES];
}
}
[[[NSApplication sharedApplication] delegate] updateBroadcastMenuState];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[itad updateBroadcastMenuState];
}
 
- (void)setSplitSelectionMode:(BOOL)mode excludingSession:(PTYSession *)session
Loading
Loading
@@ -3793,8 +3836,8 @@ NSString *sessionsKey = @"sessions";
 
if (currentScreen == menubarScreen) {
int flags = NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar;
[[[iTermApplication sharedApplication] delegate] setFutureApplicationPresentationOptions:flags
unset:0];
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
[itad setFutureApplicationPresentationOptions:flags unset:0];
}
}
 
Loading
Loading
@@ -4092,7 +4135,8 @@ NSString *sessionsKey = @"sessions";
}
 
if (windowType_ != WINDOW_TYPE_NORMAL) {
if ([[[iTermApplication sharedApplication] delegate] showToolbelt]) {
iTermApplicationDelegate *itad = (iTermApplicationDelegate *)[[iTermApplication sharedApplication] delegate];
if ([itad showToolbelt]) {
const CGFloat width = [self fullscreenToolbeltWidth];
[toolbelt_ setFrameOrigin:NSMakePoint(self.window.frame.size.width - width,
0)];
Loading
Loading
@@ -4385,7 +4429,7 @@ NSString *sessionsKey = @"sessions";
for (PTYSession* aSession in [aTab sessions]) {
[aSession setIgnoreResizeNotifications:YES];
}
NSTabViewItem* aTabViewItem = [[NSTabViewItem alloc] initWithIdentifier:aTab];
NSTabViewItem* aTabViewItem = [[NSTabViewItem alloc] initWithIdentifier:(id)aTab];
[aTabViewItem setLabel:@""];
assert(aTabViewItem);
[aTab setTabViewItem:aTabViewItem];
Loading
Loading
@@ -4665,7 +4709,7 @@ NSString *sessionsKey = @"sessions";
// closes a tab
- (void) closeTabContextualMenuAction: (id) sender
{
[self closeTab:[[sender representedObject] identifier]];
[self closeTab:(id)[[sender representedObject] identifier]];
}
 
// moves a tab with its session to a new window
Loading
Loading
@@ -4935,6 +4979,20 @@ NSString *sessionsKey = @"sessions";
return aSession;
}
 
- (void)window:(NSWindow *)window didDecodeRestorableState:(NSCoder *)state
{
[self loadArrangement:[state decodeObjectForKey:@"ptyarrangement"]];
}
- (void)window:(NSWindow *)window willEncodeRestorableState:(NSCoder *)state
{
if (wellFormed_) {
[lastArrangement_ release];
lastArrangement_ = [[self arrangement] retain];
}
[state encodeObject:lastArrangement_ forKey:@"ptyarrangement"];
}
- (NSApplicationPresentationOptions)window:(NSWindow *)window
willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
{
Loading
Loading
Loading
Loading
@@ -289,6 +289,8 @@
1DF8AF5813FD781700C8A435 /* SplitPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DF8AF5613FD781700C8A435 /* SplitPanel.h */; };
1DF8AF5913FD781700C8A435 /* SplitPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DF8AF5713FD781700C8A435 /* SplitPanel.m */; };
49A6E4091211CC6000D9AD6F /* Compatability.h in Headers */ = {isa = PBXBuildFile; fileRef = 49A6E4081211CC6000D9AD6F /* Compatability.h */; };
5ECE005F1454E59B004861E9 /* PseudoTerminalRestorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5ECE005D1454E59B004861E9 /* PseudoTerminalRestorer.h */; };
5ECE00601454E59B004861E9 /* PseudoTerminalRestorer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5ECE005E1454E59B004861E9 /* PseudoTerminalRestorer.m */; };
5ECE4AC51451343E002A9CC2 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5ECE4AC41451343E002A9CC2 /* Growl.framework */; };
5ECE4AE714513EFB002A9CC2 /* Growl.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = 5ECE4AC41451343E002A9CC2 /* Growl.framework */; };
5ECE4AE814513F05002A9CC2 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5ECE4AC41451343E002A9CC2 /* Growl.framework */; };
Loading
Loading
@@ -511,6 +513,8 @@
20E74F4804E9089700000106 /* ITAddressBookMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITAddressBookMgr.h; sourceTree = "<group>"; };
20E74F4904E9089700000106 /* ITAddressBookMgr.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ITAddressBookMgr.m; sourceTree = "<group>"; };
49A6E4081211CC6000D9AD6F /* Compatability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compatability.h; sourceTree = "<group>"; };
5ECE005D1454E59B004861E9 /* PseudoTerminalRestorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoTerminalRestorer.h; sourceTree = "<group>"; };
5ECE005E1454E59B004861E9 /* PseudoTerminalRestorer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PseudoTerminalRestorer.m; sourceTree = "<group>"; };
5ECE4AC41451343E002A9CC2 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
5ECE4AE914514058002A9CC2 /* Growl Registration Ticket.growlRegDict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Growl Registration Ticket.growlRegDict"; sourceTree = "<group>"; };
872EBC5304E42E320073D10E /* NSStringITerm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSStringITerm.h; path = Headers/iTerm/NSStringITerm.h; sourceTree = "<group>"; };
Loading
Loading
@@ -663,6 +667,8 @@
0464AB0D006CD2EC7F000001 /* JTerminal */ = {
isa = PBXGroup;
children = (
5ECE005D1454E59B004861E9 /* PseudoTerminalRestorer.h */,
5ECE005E1454E59B004861E9 /* PseudoTerminalRestorer.m */,
0464AB0E006CD2EC7F000001 /* Classes */,
0464AB15006CD2EC7F000001 /* Headers */,
1DEE9FDB11FCA60F009E18C9 /* credits.rtf */,
Loading
Loading
@@ -1274,6 +1280,7 @@
1D24C2C5142FEACF006B246F /* SmartSelectionController.h in Headers */,
1D4AE8FE14343A760092EB49 /* TrouterPrefsController.h in Headers */,
1DEDC8FD1451F67D004F1615 /* SessionTitleView.h in Headers */,
5ECE005F1454E59B004861E9 /* PseudoTerminalRestorer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Loading
Loading
@@ -1544,6 +1551,7 @@
1D24C2C6142FEACF006B246F /* SmartSelectionController.m in Sources */,
1D4AE8FF14343A760092EB49 /* TrouterPrefsController.m in Sources */,
1DEDC8FE1451F67D004F1615 /* SessionTitleView.m in Sources */,
5ECE00601454E59B004861E9 /* PseudoTerminalRestorer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Loading
Loading
@@ -1690,7 +1698,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_LDFLAGS = "-licucore";
PRODUCT_NAME = iTerm;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
SECTORDER_FLAGS = "";
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
Loading
Loading
@@ -1728,7 +1736,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_LDFLAGS = "-licucore";
PRODUCT_NAME = iTerm;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = app;
Loading
Loading
@@ -1766,7 +1774,7 @@
OTHER_REZFLAGS = "";
PRODUCT_NAME = iTerm;
REZ_EXECUTABLE = YES;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
SECTORDER_FLAGS = "";
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
Loading
Loading
@@ -1791,7 +1799,7 @@
GENERATE_PROFILING_CODE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
};
Loading
Loading
@@ -1808,7 +1816,7 @@
GCC_WARN_SIGN_COMPARE = NO;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
};
Loading
Loading
@@ -1824,7 +1832,7 @@
GCC_WARN_SIGN_COMPARE = NO;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
VALID_ARCHS = x86_64;
WARNING_CFLAGS = "-Wall";
};
Loading
Loading
Loading
Loading
@@ -178,7 +178,9 @@ static BOOL hasBecomeActive = NO;
}
} else if ([[PreferencePanel sharedInstance] openArrangementAtStartup]) {
[[iTermController sharedInstance] loadWindowArrangementWithName:[WindowArrangements defaultArrangementName]];
} else {
} else if (!IsLionOrLater() || ![[NSUserDefaults standardUserDefaults] objectForKey:@"NotFirstRun"]) {
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES]
forKey:@"NotFirstRun"];
[self newWindow:nil];
}
}
Loading
Loading
Loading
Loading
@@ -81,7 +81,7 @@ static NSInteger _compareEncodingByLocalizedName(id a, id b, void *unused)
return [sa caseInsensitiveCompare: sb];
}
 
BOOL IsLionOrLater(void) {
static BOOL UncachedIsLionOrLater(void) {
unsigned major;
unsigned minor;
if ([iTermController getSystemVersionMajor:&major minor:&minor bugFix:nil]) {
Loading
Loading
@@ -91,6 +91,16 @@ BOOL IsLionOrLater(void) {
}
}
 
BOOL IsLionOrLater(void) {
static BOOL result;
static BOOL initialized;
if (!initialized) {
initialized = YES;
result = UncachedIsLionOrLater();
}
return result;
}
BOOL IsSnowLeopardOrLater(void) {
unsigned major;
unsigned minor;
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