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

Merge branch 'master' of github.com:gnachman/iTerm2

parents 2f4031b9 c7679b3a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -105,6 +105,9 @@ BOOL IsLionOrLater(void);
- (NSArray*)sortedEncodingList;
- (void)addBookmarksToMenu:(NSMenu *)aMenu startingAt:(int)startingAt;
- (void)addBookmarksToMenu:(NSMenu *)aMenu withSelector:(SEL)selector openAllSelector:(SEL)openAllSelector startingAt:(int)startingAt;
- (id)launchBookmark:(NSDictionary *)bookmarkData
inTerminal:(PseudoTerminal *)theTerm
disableLionFullscreen:(BOOL)disableLionFullscreen;
- (id)launchBookmark:(NSDictionary*)bookmarkData inTerminal:(PseudoTerminal*)theTerm;
- (id)launchBookmark:(NSDictionary *)bookmarkData inTerminal:(PseudoTerminal *)theTerm withCommand:(NSString *)command;
- (id)launchBookmark:(NSDictionary*)bookmarkData inTerminal:(PseudoTerminal*)theTerm withURL:(NSString*)url;
Loading
Loading
Loading
Loading
@@ -63,6 +63,10 @@ static const int MAX_WORKING_DIR_COUNT = 50;
#include <sys/time.h>
#include <math.h>
 
// When performing the "find cursor" action, a gray window is shown with a
// transparent "hole" around the cursor. This is the radius of that hole in
// pixels.
const double kFindCursorHoleRadius = 30;
 
@implementation FindCursorView
 
Loading
Loading
@@ -78,9 +82,8 @@ static const int MAX_WORKING_DIR_COUNT = 50;
double y = cursor.y;
 
const double numSteps = 2;
const double finalRadius = 30;
const double stepSize = 2;
const double initialRadius = finalRadius + numSteps * stepSize;
const double initialRadius = kFindCursorHoleRadius + numSteps * stepSize;
double a = initialAlpha;
for (double focusRadius = initialRadius; a > 0 && focusRadius >= initialRadius - numSteps * stepSize; focusRadius -= stepSize) {
[[NSGraphicsContext currentContext] setCompositingOperation:NSCompositeCopy];
Loading
Loading
@@ -4224,7 +4227,7 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
[self setNeedsDisplay:YES];
}
 
- (NSPoint)globalCursorLocation
- (NSPoint)cursorLocationInScreenCoordinates
{
NSRect frame = [self visibleRect];
double x = MARGIN + charWidth * ([dataSource cursorX] - 1) + charWidth/2;
Loading
Loading
@@ -4239,22 +4242,47 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
return p;
}
 
// Returns the location of the cursor relative to the origin of findCursorWindow_.
- (NSPoint)globalCursorLocation
{
NSPoint p = [self cursorLocationInScreenCoordinates];
p = [findCursorWindow_ convertScreenToBase:p];
return p;
}
// Returns the proper frame for findCursorWindow_, including every screen that the
// "hole" will be in.
- (NSRect)_cursorScreenFrame
{
NSRect frame = NSZeroRect;
for (NSScreen *aScreen in [NSScreen screens]) {
NSRect screenFrame = [aScreen frame];
if (NSIntersectsRect([[self window] frame], screenFrame)) {
frame = NSUnionRect(frame, screenFrame);
}
}
if (NSEqualRects(frame, NSZeroRect)) {
frame = [[self window] frame];
}
return frame;
}
- (void)createFindCursorWindow
{
findCursorWindow_ = [[NSWindow alloc] initWithContentRect:[[[self window] screen] frame]
findCursorWindow_ = [[NSWindow alloc] initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:YES
screen:[[self window] screen]];
defer:YES];
[findCursorWindow_ setOpaque:NO];
[findCursorWindow_ makeKeyAndOrderFront:nil];
[findCursorWindow_ setLevel:NSFloatingWindowLevel];
[findCursorWindow_ setAlphaValue:0];
[findCursorWindow_ setFrame:[self _cursorScreenFrame] display:YES];
[[NSAnimationContext currentContext] setDuration:0.5];
[[findCursorWindow_ animator] setAlphaValue:1];
NSPoint p = [self globalCursorLocation];
 
findCursorView_ = [[FindCursorView alloc] initWithFrame:NSMakeRect(0, 0, [[self window] frame].size.width, [[self window] frame].size.height)];
NSPoint p = [self globalCursorLocation];
findCursorView_.cursor = p;
[findCursorWindow_ setContentView:findCursorView_];
[findCursorView_ release];
Loading
Loading
Loading
Loading
@@ -3694,7 +3694,8 @@ NSString *sessionsKey = @"sessions";
{
[fullScreenTabviewTimer_ release];
fullScreenTabviewTimer_ = nil;
if (_fullScreen) {
// Don't show the tabbar if you're holding cmd while doing find cursor
if (_fullScreen && ![[[self currentSession] TEXTVIEW] isFindingCursor]) {
[self showFullScreenTabControl];
}
}
Loading
Loading
Loading
Loading
@@ -1586,7 +1586,7 @@
PRODUCT_NAME = iTerm;
SDKROOT = macosx10.5;
SECTORDER_FLAGS = "";
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
Loading
Loading
@@ -1618,7 +1618,7 @@
OTHER_LDFLAGS = "-licucore";
PRODUCT_NAME = iTerm;
SDKROOT = macosx10.5;
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = app;
ZERO_LINK = NO;
Loading
Loading
@@ -1652,7 +1652,7 @@
REZ_EXECUTABLE = YES;
SDKROOT = macosx10.5;
SECTORDER_FLAGS = "";
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = app;
};
Loading
Loading
@@ -1676,7 +1676,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
};
name = Development;
Loading
Loading
@@ -1684,11 +1684,7 @@
BB024D3B096EE4080021E793 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
x86_64,
ppc,
);
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = 4.2;
Loading
Loading
@@ -1697,7 +1693,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
};
name = Deployment;
Loading
Loading
@@ -1705,11 +1701,7 @@
BB024D3C096EE4080021E793 /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
x86_64,
ppc,
);
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)";
GCC_VERSION = 4.2;
GCC_WARN_PROTOTYPE_CONVERSION = NO;
Loading
Loading
@@ -1717,7 +1709,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.5;
VALID_ARCHS = "i386 x86_64 ppc";
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
};
name = Default;
Loading
Loading
Loading
Loading
@@ -786,7 +786,9 @@ static BOOL IsSnowLeopardOrLater() {
}
 
// Executes an addressbook command in new window or tab
- (id)launchBookmark:(NSDictionary *)bookmarkData inTerminal:(PseudoTerminal *)theTerm
- (id)launchBookmark:(NSDictionary *)bookmarkData
inTerminal:(PseudoTerminal *)theTerm
disableLionFullscreen:(BOOL)disableLionFullscreen
{
PseudoTerminal *term;
NSDictionary *aDict;
Loading
Loading
@@ -806,8 +808,12 @@ static BOOL IsSnowLeopardOrLater() {
BOOL toggle = NO;
if (theTerm == nil) {
[iTermController switchToSpaceInBookmark:aDict];
int windowType = [self _windowTypeForBookmark:aDict];
if (windowType == WINDOW_TYPE_LION_FULL_SCREEN && disableLionFullscreen) {
windowType = WINDOW_TYPE_FULL_SCREEN;
}
term = [[[PseudoTerminal alloc] initWithSmartLayout:YES
windowType:[self _windowTypeForBookmark:aDict]
windowType:windowType
screen:[aDict objectForKey:KEY_SCREEN] ? [[aDict objectForKey:KEY_SCREEN] intValue] : -1] autorelease];
[self addInTerminals:term];
toggle = ([term windowType] == WINDOW_TYPE_FULL_SCREEN) ||
Loading
Loading
@@ -830,6 +836,11 @@ static BOOL IsSnowLeopardOrLater() {
return session;
}
 
- (id)launchBookmark:(NSDictionary *)bookmarkData inTerminal:(PseudoTerminal *)theTerm
{
return [self launchBookmark:bookmarkData inTerminal:theTerm disableLionFullscreen:NO];
}
// I don't think this function is ever called.
- (id)launchBookmark:(NSDictionary *)bookmarkData inTerminal:(PseudoTerminal *)theTerm withCommand:(NSString *)command
{
Loading
Loading
@@ -1214,7 +1225,7 @@ static BOOL OpenHotkeyWindow()
forKey:KEY_WINDOW_TYPE];
bookmark = replacement;
}
PTYSession* session = [cont launchBookmark:bookmark inTerminal:nil];
PTYSession* session = [cont launchBookmark:bookmark inTerminal:nil disableLionFullscreen:YES];
PseudoTerminal* term = [[session tab] realParentWindow];
[term setIsHotKeyWindow:YES];
 
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