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

Fix menu shortcuts not working after a webview is shown #154648

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

ssigwart
Copy link
Contributor

@ssigwart ssigwart commented Jul 9, 2022

This PR is for #71800

Release notes, markdown preview, etc. use a web view. The web view uses WindowIgnoreMenuShortcutsManager/allowMenuShortcuts to disable menu shortcuts.
However, WindowIgnoreMenuShortcutsManager.didBlur isn't being called when the editor is closed, so the menu shortcuts stay disabled.

This seems to be a side effect of the fix for #82670.

This does not solve using Cmd+M or Cmd+H while focused on a web view. I looked into detecting those keys and enabling menu shortcuts, but it seems like MacOS still won't detect them if you enable menu shortcuts after the key stroke is pressed but before the event is finished processing.

Testing

  • On a Mac, open a markdown preview or release notes, then close the editor.
  • Use Cmd+M or Cmd+H. it should work to minimize or hide the window.

Release notes, markdown preview, etc. use a web view. The web view uses `WindowIgnoreMenuShortcutsManager`/`allowMenuShortcuts` to disable menu shortcuts.
However, `WindowIgnoreMenuShortcutsManager.didBlur` isn't being called when the editor is closed, so the menu shortcuts stay disabled.

This seems to be a side effect of the fix for microsoft#82670.

This does not solve using Cmd+M or Cmd+H while focused on a web view.  I looked into detecting those keys and enabling menu shortcuts, but it seems like MacOS still won't detect them if you enable menu shortcuts after the key stroke is pressed but before the event is finished processing.
@mjbvz mjbvz merged commit 112b2d0 into microsoft:main Jul 12, 2022
@mjbvz
Copy link
Collaborator

mjbvz commented Jul 12, 2022

Thanks! I've merged this but am keeping #71800 open since it sounds like the issue still exists when focused on a webview

@ssigwart ssigwart deleted the webviewMinimize branch July 12, 2022 02:48
@ssigwart
Copy link
Contributor Author

Thanks for the quick review, @mjbvz. I tried tackling the rest of this in #154882, though I'm not sure if it's the right direction or not.

andreamah pushed a commit that referenced this pull request Jul 14, 2022
Release notes, markdown preview, etc. use a web view. The web view uses `WindowIgnoreMenuShortcutsManager`/`allowMenuShortcuts` to disable menu shortcuts.
However, `WindowIgnoreMenuShortcutsManager.didBlur` isn't being called when the editor is closed, so the menu shortcuts stay disabled.

This seems to be a side effect of the fix for #82670.

This does not solve using Cmd+M or Cmd+H while focused on a web view.  I looked into detecting those keys and enabling menu shortcuts, but it seems like MacOS still won't detect them if you enable menu shortcuts after the key stroke is pressed but before the event is finished processing.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants