correctly set global autotype on initailizer

This commit is contained in:
Michael Starke
2020-10-08 23:28:54 +02:00
parent bda0a25fe0
commit 2ad4bd2abc
2 changed files with 4 additions and 2 deletions

View File

@@ -20,14 +20,16 @@
- (instancetype)initWithTargetApplication:(NSRunningApplication *)targetApplication entry:(KPKEntry *)entry overrideSequence:(NSString *)overrdieSequence {
self = [super init];
if(self) {
_globalAutotype = NO;
_preferredEntry = entry;
_hidden = NSRunningApplication.currentApplication.isHidden;
_overrideSequence = [overrdieSequence copy];
/* capture the front most application if no one was supplied */
if(nil == targetApplication) {
_globalAutotype = YES;
targetApplication = NSWorkspace.sharedWorkspace.frontmostApplication;
}
if(!targetApplication) {
if(nil == targetApplication) {
_pid = -1;
_windowTitle = @"";
}