Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Macos can't add word to favorite by shortcut in pop up window. #2021

Open
laraws opened this issue Dec 14, 2024 · 1 comment
Open

[bug] Macos can't add word to favorite by shortcut in pop up window. #2021

laraws opened this issue Dec 14, 2024 · 1 comment
Labels
macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted.

Comments

@laraws
Copy link

laraws commented Dec 14, 2024

Describe the bug
I use command+c,c to search translate a word from clipboard, it pops up a small window. Then I try to use command+e to add this word to favorite, it doesn't work.

To Reproduce
Steps to reproduce the behavior:

  1. use command+c,c to search translate a word from clipboard
  2. use command+e to add this word to favorite

Screenshots
image

OS and software versions

Goldendict-ng 24.09.1.ca9dd133 at 2024-11-04T21:40:54Z
Qt 6.6.3 Clang 15.0.0 (clang-1500.3.9.4) macos darwin 22.6.0 arm64-little_endian-lp64
Flags: MAKE_ZIM_SUPPORT MAKE_CHINESE_CONVERSION_SUPPORT NO_TTS_SUPPORT no_ffmpeg_player

  • OS: Macos 13.5 M1

Additional context
Add any other context about the problem here.

Please fix this bug, thank you.

@laraws laraws changed the title [bug] Macos can't add word to favorite in pop up window. [bug] Macos can't add word to favorite by shortcut in pop up window. Dec 14, 2024
@shenlebantongying shenlebantongying added the macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted. label Dec 15, 2024
@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Dec 15, 2024

Just for the record, no idea how much work is needed to fix this (the menu is in the .ui file instead of .cc).

There are two causes:

  1. macOS, the system itself handles menu bar shortcuts.
    • Once a menu bar item have shortcut registered, macOS will handle the shortcut. From app's point of view, only the triggering of that menu item can be observed.
    • There is absolutely no way to do anything about this by the app or Qt.
  2. macOS's menubar is associated with the whole app, instead of one window. So hiding the main window won't deactivate the menu bar.

When the popup windows show up, the menu bar will also show up, and the macOS's shortcut handling will handle shortcuts on the menu bar and the app cannot observe related key pressing in the popup window.

(Observed bug: When only popup shows up, press any shortcuts that conflicts with the menu bar, the menu bar will flash/highlight indicating that some item triggered.)

One of the proper fixes is deactivating the menu bar when the main window is hidden. (There are other ways).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Like most cross-platform projects, this one also lacks macOS developers. Help wanted.
Projects
None yet
Development

No branches or pull requests

2 participants