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

Restore tab's size after it's dragged into its own window. Fixes bug 986.

parent 5ccbcd67
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -180,6 +180,10 @@
// Window number, used for keyboard shortcut to select a window.
// This value is 0-based while the UI is 1-based.
int number_;
// True if this window was created by dragging a tab from another window.
// Affects how its size is set when the number of tabview items changes.
BOOL wasDraggedFromAnotherWindow_;
}
 
// Initialize a new PseudoTerminal.
Loading
Loading
Loading
Loading
@@ -1849,8 +1849,20 @@ NSString *sessionsKey = @"sessions";
if (([TABVIEW numberOfTabViewItems] == 1) ||
([[PreferencePanel sharedInstance] hideTab] && ([TABVIEW numberOfTabViewItems] > 1 && [tabBarControl isHidden]))) {
PtyLog(@"tabViewDidChangeNumberOfTabViewItems - calling fitWindowToTab");
PTYTab* firstTab = [[[TABVIEW tabViewItems] objectAtIndex:0] identifier];
if (wasDraggedFromAnotherWindow_) {
// A tab was just dragged out of another window's tabbar into its own window.
// When this happens, it loses its size. This is our only chance to resize it.
// So we put it in a mode where it will resize to its "ideal" size instead of
// its incorrect current size.
[firstTab setReportIdealSizeAsCurrent:YES];
}
[self fitWindowToTabs];
[self repositionWidgets];
if (wasDraggedFromAnotherWindow_) {
wasDraggedFromAnotherWindow_ = NO;
[firstTab setReportIdealSizeAsCurrent:NO];
}
}
 
int i;
Loading
Loading
@@ -1946,7 +1958,7 @@ NSString *sessionsKey = @"sessions";
if (term == nil) {
return nil;
}
term->wasDraggedFromAnotherWindow_ = YES;
[term copySettingsFrom:self];
 
[[iTermController sharedInstance] addInTerminals: term];
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