tisfeng / Easydict

一个简洁优雅的词典翻译 macOS App。开箱即用,支持离线 OCR 识别,支持有道词典,🍎 苹果系统词典,🍎 苹果系统翻译,OpenAI,Gemini,DeepL,Google,Bing,腾讯,百度,阿里,小牛,彩云和火山翻译。A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
6.38k stars 324 forks source link

perf: use CGRequestScreenCaptureAccess to get screen permission #591

Closed tisfeng closed 2 weeks ago

tisfeng commented 2 weeks ago

And show alert if has no screen access.

Close https://github.com/tisfeng/Easydict/issues/587

tisfeng commented 2 weeks ago

There was an issue with the previous code. We should use CGPreflightScreenCaptureAccess to check for authorization status. If permission is not granted, use CGRequestScreenCaptureAccess to request access ba9b26c9 .

@Jerry23011 Please test again.

Jerry23011 commented 2 weeks ago

Now we have a new-looking popup requesting permission when the app is first installed. However, the warning popup still persists after Mac restart.

tisfeng commented 2 weeks ago

It's strange, this PR code seems fine, I think we can merge it first.

There's no further information on the macOS 15 beta yet, we'll keep an eye on it.