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

Fix leak of password manager sheet window. Also add advanced pref to disable...

Fix leak of password manager sheet window. Also add advanced pref to disable its animation. Issue 5794
parent 40d17c9f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -65,6 +65,7 @@
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableAddressSanitizer = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
Loading
Loading
Loading
Loading
@@ -86,7 +86,7 @@
#import "VT100Screen.h"
#import "VT100Terminal.h"
#include "iTermFileDescriptorClient.h"
#import <QuartzCore/QuartzCore.h>
#include <unistd.h>
 
@class QLPreviewPanel;
Loading
Loading
@@ -344,6 +344,7 @@ static NSRect iTermRectCenteredVerticallyWithinRect(NSRect frameToCenter, NSRect
// life because it remains possible to have no auto-layout as long as you don't use title bar
// accessories. To see the whole mess, check out the clusterfuck[123] branches.
iTermWindowShortcutLabelTitlebarAccessoryViewController *_shortcutAccessoryViewController;
#endif
 
// Is there a pending delayed-perform of enterFullScreen:? Used to figure
Loading
Loading
@@ -361,6 +362,8 @@ static NSRect iTermRectCenteredVerticallyWithinRect(NSRect frameToCenter, NSRect
 
// Used to prevent infinite re-entrancy in windowDidChangeScreen:.
BOOL _inWindowDidChangeScreen;
iTermPasswordManagerWindowController *_passwordManagerWindowController;
}
 
+ (void)registerSessionsInArrangement:(NSDictionary *)arrangement {
Loading
Loading
@@ -815,6 +818,8 @@ ITERM_WEAKLY_REFERENCEABLE
[_desiredTitle release];
[_tabsTouchBarItem release];
[_autocompleteCandidateListItem release];
[_passwordManagerWindowController release];
[super dealloc];
}
 
Loading
Loading
@@ -4743,16 +4748,33 @@ ITERM_WEAKLY_REFERENCEABLE
DLog(@"openPasswordManagerToAccountName:%@ inSession:%@", name, session);
[session reveal];
DLog(@"Show the password manager as a sheet");
iTermPasswordManagerWindowController *passwordManagerWindowController =
[[iTermPasswordManagerWindowController alloc] init];
passwordManagerWindowController.delegate = self;
[self.window beginSheet:[passwordManagerWindowController window] completionHandler:^(NSModalResponse returnCode) {
[[passwordManagerWindowController window] close];
[[passwordManagerWindowController window] release];
_passwordManagerWindowController.delegate = nil;
[_passwordManagerWindowController autorelease];
_passwordManagerWindowController = [[iTermPasswordManagerWindowController alloc] init];
_passwordManagerWindowController.delegate = self;
BOOL noAnimations = [iTermAdvancedSettingsModel disablePasswordManagerAnimations];
if (noAnimations) {
[CATransaction begin];
[CATransaction setValue:@YES
forKey:kCATransactionDisableActions];
}
[self.window beginSheet:[_passwordManagerWindowController window] completionHandler:^(NSModalResponse returnCode) {
if (noAnimations) {
[CATransaction begin];
[CATransaction setValue:@YES
forKey:kCATransactionDisableActions];
}
[[_passwordManagerWindowController window] close];
if (noAnimations) {
[CATransaction commit];
}
}];
if (noAnimations) {
[CATransaction commit];
}
 
[passwordManagerWindowController selectAccountName:name];
[_passwordManagerWindowController selectAccountName:name];
}
 
- (void)genericCloseSheet:(NSWindow *)sheet
Loading
Loading
Loading
Loading
@@ -186,5 +186,6 @@
+ (BOOL)killSessionsOnLogout;
+ (BOOL)tmuxUsesDedicatedProfile;
+ (BOOL)detectPasswordInput;
+ (BOOL)disablePasswordManagerAnimations;
 
@end
Loading
Loading
@@ -118,6 +118,7 @@ DEFINE_STRING(findUrlsRegex,
@"((:[0-9]+)?)(/[a-zA-Z0-9;:/\\.\\-_+%~?&amp;@=#\\(\\)]*)?",
@"Terminal: Regular expression for “Find URLs” command.");
DEFINE_FLOAT(echoProbeDuration, 0.5, @"Terminal: Amount of time to wait while testing if echo is on (seconds).\nThis is used by the password manager to ensure you're at a password prompt.");
DEFINE_BOOL(disablePasswordManagerAnimations, NO, @"Terminal: Disable animations for showing/hiding password manager.");
DEFINE_BOOL(optionIsMetaForSpecialChars, YES, @"Terminal: When you press an arrow key or other function key that transmits the modifiers, should Option be translated to Meta?\nIf this is set to No then it will be translated to Alt.");
DEFINE_BOOL(noSyncSilenceAnnoyingBellAutomatically, NO, @"Terminal: Automatically silence bell when it rings too much.");
DEFINE_BOOL(restoreWindowContents, YES, @"Terminal: Restore window contents at startup.\nThis requires “System Prefs>General>Close windows when quitting an app” to be off.");
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