From 9791e5e5f6e148af4b30afe7dfc7f03b5a8f4839 Mon Sep 17 00:00:00 2001 From: phlpsong Date: Tue, 23 Jan 2024 20:10:18 +0800 Subject: [PATCH] fix: add disable app by dragging lag issue --- Easydict/Feature/EventMonitor/EZEventMonitor.m | 7 +++++++ .../EZDisableAutoSelectTextViewController.m | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Easydict/Feature/EventMonitor/EZEventMonitor.m b/Easydict/Feature/EventMonitor/EZEventMonitor.m index f3acfe5ab..102885a35 100644 --- a/Easydict/Feature/EventMonitor/EZEventMonitor.m +++ b/Easydict/Feature/EventMonitor/EZEventMonitor.m @@ -143,8 +143,15 @@ - (EZTriggerType)getAppSelectTextActionType:(NSString *)appBundleID wechat.appBundleID = @"com.tencent.xinWeChat"; wechat.triggerType = EZTriggerTypeDoubleClick | EZTriggerTypeTripleClick; + // https://github.com/tisfeng/Easydict/issues/346 + // Add Easydict self as block app + EZAppModel *selfApp = [[EZAppModel alloc] init]; + selfApp.appBundleID = [[NSBundle mainBundle] bundleIdentifier]; + selfApp.triggerType = EZTriggerTypeNone; + NSArray *defaultAppModels = @[ wechat, + selfApp ]; return defaultAppModels; diff --git a/Easydict/Feature/PerferenceWindow/DisableAutoSelectTextViewController/EZDisableAutoSelectTextViewController.m b/Easydict/Feature/PerferenceWindow/DisableAutoSelectTextViewController/EZDisableAutoSelectTextViewController.m index 86a5c8e56..39017c32c 100644 --- a/Easydict/Feature/PerferenceWindow/DisableAutoSelectTextViewController/EZDisableAutoSelectTextViewController.m +++ b/Easydict/Feature/PerferenceWindow/DisableAutoSelectTextViewController/EZDisableAutoSelectTextViewController.m @@ -254,9 +254,6 @@ - (void)selectApp { NSArray *allowedTypes = @[ UTTypeApplication ]; [openPanel setAllowedContentTypes:allowedTypes]; - // ???: Since [auto select] will cause lag when dragging select apps, I don't know why 😰 - Configuration.shared.disabledAutoSelect = YES; - NSModalResponse result = [openPanel runModal]; if (result == NSModalResponseOK) { NSLog(@"selected URLs: %@", openPanel.URLs); @@ -267,8 +264,6 @@ - (void)selectApp { [self.tableView reloadData]; } - - Configuration.shared.disabledAutoSelect = NO; } - (NSArray *)appModelsFromBundleIDDict:(NSDictionary *)appBundleIDDict {