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.92k stars 352 forks source link

🐞 Bug Report: query window dismissed before showing the result in Stage Manager mode #381

Closed phlpsong closed 7 months ago

phlpsong commented 7 months ago

Please confirm the following:

Problem description

query window dismissed before showing the result in Stage Manager mode

Reproduction steps

  1. Enable Stage Manager mode in system settings and unchecked Hide main window at startup
  2. Select text to query

Screenshot

https://github.com/tisfeng/Easydict/assets/103433299/c3078ab7-a5d8-4612-85e2-f484545d2605

Expected result

The query window stays visible

Proposed solution (optional)

No response

Device type and OS version

macOS 14.2.1

Are you willing to submit a PR to fix this issue?

phlpsong commented 7 months ago

I noticed that we check [EZMainQueryWindow isAlive] twice in the showFloatingWindow function of EZWindowManager and then perform orderOut and orderBack on the mainWindow.

Is it necessary to have the subsequent orderBack?

tisfeng commented 7 months ago

Currently the window management in the code is confusing, it needs to be improved https://github.com/tisfeng/Easydict/issues/362 , but I'm not too familiar with this.

Previously I found that if the main window is turned on, when displaying the mini query window, the main window needs to be hidden first for a better user experience, if don't call orderBack, we can't see main window any more. But now I tested it and it seems to work without orderBack, which is strange.

I haven't tested this in Stage Manager mode before, you can try to fix this as you see fit.

tisfeng commented 7 months ago

2.6.0 新版本已修复该问题。