mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52:21 +00:00
moving autotype execution to main thread
This commit is contained in:
@@ -242,12 +242,14 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
/* TODO - we can use a saver way and use a notification to check if the app actally was activated */
|
/* TODO - we can use a saver way and use a notification to check if the app actally was activated */
|
||||||
usleep(1 * NSEC_PER_MSEC);
|
usleep(1 * NSEC_PER_MSEC);
|
||||||
}
|
}
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
||||||
for(MPAutotypeCommand *command in [MPAutotypeCommand commandsForContext:context]) {
|
for(MPAutotypeCommand *command in [MPAutotypeCommand commandsForContext:context]) {
|
||||||
|
/* dispatch commands to main thread since most of them translate key events which is disallowed on background thread */
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[command execute];
|
[command execute];
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Hotkey Registration
|
#pragma mark Hotkey Registration
|
||||||
|
|||||||
Reference in New Issue
Block a user