Fixed autotype regression preventing self-autotyping. Added re-hiding for special placeholders

This commit is contained in:
Michael Starke
2020-01-28 10:28:42 +01:00
parent 9409887942
commit c85a9cdce1
2 changed files with 9 additions and 2 deletions

View File

@@ -190,7 +190,10 @@ static MPAutotypeDaemon *_sharedInstance;
}
- (void)_runAutotypeWithEnvironment:(MPAutotypeEnvironment *)env {
if(env.isSelfTargeting) {
return; // we do not want to target ourselves
}
if(!self.hasNecessaryAutotypePermissions) {
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = NSLocalizedString(@"AUTOTYPE_NOTIFICATION_PERMISSIONS_MISSING_TITLE", "Title for autotype feedback on missing permissions");
@@ -329,6 +332,10 @@ static MPAutotypeDaemon *_sharedInstance;
usleep(globalDelay*NSEC_PER_USEC);
}
[command execute];
/* re-hide after every command since this might have put us back up front */
if(environment.hidden) {
[NSApplication.sharedApplication hide:nil];
}
});
}
}

View File

@@ -47,7 +47,7 @@
}
- (BOOL)isSelfTargeting {
return NSRunningApplication.currentApplication.processIdentifier != _pid;
return NSRunningApplication.currentApplication.processIdentifier == _pid;
}
- (NSDictionary *)_infoDictionaryForApplication:(NSRunningApplication *)application {