Skip to content
New issue

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

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

Already on GitHub? # to your account

Using OA+O while menu showing is treated as OA+SA+O #796

Closed
inexorabletash opened this issue Jun 11, 2024 · 0 comments
Closed

Using OA+O while menu showing is treated as OA+SA+O #796

inexorabletash opened this issue Jun 11, 2024 · 0 comments
Labels
bug DeskTop DeskTop bugs or feature requests
Milestone

Comments

@inexorabletash
Copy link
Collaborator

Describe the bug
MGTK supports using shortcuts (e.g. OA+O) while a menu is showing.

If the menu is invoked using the mouse, but then the shortcut is used, DeskTop gets confused about how to interpret the modifiers.

To Reproduce
Steps to reproduce the behavior:

  1. Start DeskTop
  2. Open a volume window
  3. Select a folder
  4. Using the mouse, click on the Apple Menu
  5. Hold Open Apple and press O

Expected behavior
The folder window opens.

Actual behavior
The folder window opens, but then the volume window closes!

Root cause
DeskTop sets a flag (menu_kbd_flag) before invoking MGTK::MenuSelect (false) or MGTK::MenuKey (true) and then checks it in CmdOpen:

  • If menu_kbd_flag is false, then the menu was invoked with the mouse:
    • If no modifier is down, treat this as CmdOpen
    • If a modifier is down, treat this as CmdOpenThenCloseCurrent
  • If menu_kbd_flag is true, then the menu was invoked with the keyboard; the caller already distinguished between single modifier as CmdOpen and double-modifier as CmdOpenThenCloseCurrent

This falls apart if the menu is invoked with the mouse, then the shortcut is used. MGTK doesn't tell the caller how the menu item was invoked, just which item was invoked.

This dates back to at least 1.3 so it isn't a regression, and I can't think of a safe fix.

@inexorabletash inexorabletash added bug DeskTop DeskTop bugs or feature requests labels Jun 11, 2024
@inexorabletash inexorabletash added this to the 1.5 milestone Oct 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug DeskTop DeskTop bugs or feature requests
Projects
None yet
Development

No branches or pull requests

1 participant