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

Restore hotkey windows' screen setting from arrangements. Issue 5627

parent af685cec
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1795,18 +1795,8 @@ ITERM_WEAKLY_REFERENCEABLE
return windowType;
}
 
+ (int)_screenIndexForArrangement:(NSDictionary*)arrangement
{
int screenIndex;
if ([arrangement objectForKey:TERMINAL_ARRANGEMENT_SCREEN_INDEX]) {
screenIndex = [[arrangement objectForKey:TERMINAL_ARRANGEMENT_SCREEN_INDEX] intValue];
} else {
screenIndex = 0;
}
if (screenIndex < 0 || screenIndex >= [[NSScreen screens] count]) {
screenIndex = 0;
}
return screenIndex;
+ (int)_screenIndexForArrangement:(NSDictionary*)arrangement {
return [[arrangement objectForKey:TERMINAL_ARRANGEMENT_SCREEN_INDEX] intValue];
}
 
+ (void)drawArrangementPreview:(NSDictionary*)terminalArrangement
Loading
Loading
@@ -1814,6 +1804,9 @@ ITERM_WEAKLY_REFERENCEABLE
{
int windowType = [PseudoTerminal _windowTypeForArrangement:terminalArrangement];
int screenIndex = [PseudoTerminal _screenIndexForArrangement:terminalArrangement];
if (screenIndex < 0 || screenIndex >= [[NSScreen screens] count]) {
screenIndex = 0;
}
NSRect virtualScreenFrame = [[frames objectAtIndex:screenIndex] rectValue];
NSRect screenFrame = [[[NSScreen screens] objectAtIndex:screenIndex] frame];
double xScale = virtualScreenFrame.size.width / screenFrame.size.width;
Loading
Loading
@@ -2098,11 +2091,10 @@ ITERM_WEAKLY_REFERENCEABLE
break;
}
}
// TODO: this looks like a bug - are X-of-screen windows not restored to the right screen?
term = [[[PseudoTerminal alloc] initWithSmartLayout:NO
windowType:windowType
savedWindowType:WINDOW_TYPE_NORMAL
screen:-1
screen:screenIndex
hotkeyWindowType:hotkeyWindowType] autorelease];
 
NSRect rect;
Loading
Loading
@@ -2386,7 +2378,11 @@ ITERM_WEAKLY_REFERENCEABLE
 
result[TERMINAL_ARRANGEMENT_WINDOW_TYPE] = @([self lionFullScreen] ? WINDOW_TYPE_LION_FULL_SCREEN : windowType_);
result[TERMINAL_ARRANGEMENT_SAVED_WINDOW_TYPE] = @(savedWindowType_);
result[TERMINAL_ARRANGEMENT_SCREEN_INDEX] = @([[NSScreen screens] indexOfObjectIdenticalTo:[[self window] screen]]);
if (_hotkeyWindowType == iTermHotkeyWindowTypeNone) {
result[TERMINAL_ARRANGEMENT_SCREEN_INDEX] = @([[NSScreen screens] indexOfObjectIdenticalTo:[[self window] screen]]);
} else {
result[TERMINAL_ARRANGEMENT_SCREEN_INDEX] = @(_screenNumberFromFirstProfile);
}
result[TERMINAL_ARRANGEMENT_DESIRED_ROWS] = @(desiredRows_);
result[TERMINAL_ARRANGEMENT_DESIRED_COLUMNS] = @(desiredColumns_);
 
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