Skip to content

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

Merged
mjbvz merged 1 commit into
microsoft:mainfrom
ssigwart:webviewMinimize
Jul 12, 2022
Merged

Fix menu shortcuts not working after a webview is shown#154648
mjbvz merged 1 commit into
microsoft:mainfrom
ssigwart:webviewMinimize

Conversation

@ssigwart
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants