Open zhaop opened 5 days ago
I can reproduce the issue, removing the setServicesMenu
call in https://github.com/rust-windowing/winit/blob/82d9bbe5598c8605a752641a477261de01340aed/src/platform_impl/apple/appkit/menu.rs#L85 prevents the hang.
The hang is also present in bog-standard applications created via. Xcode, try creating a new Xcode app, restart Xcode (or kill the lldb-rpc-server
process), debug the application, and then close it with CMD + Q
. The hang is less noticeable there because:
In any case, I'm not sure what you want Winit to do about it? Maybe you could file an issue with LLDB or Apple instead?
Description
When I run the window example with lldb:
and when I press Ctrl+key or Cmd+key for the first time, lldb hangs for a while and loads a bunch of symbol tables with Apple-sounding names, which causes the example app to hang for 1-2s. Subsequent shortcut presses do not cause this hang.
I've bisected this behavior to 075996b1, which fixes #3231 "feat: macos services menu added". Prior to this commit, reproducing the steps above does not cause a hang.
This also happens when I launch the window example as above, then go to the top left corner of my screen and hover over the "Services >" menu item -- lldb also loads symbol tables for 1-2 seconds, the "Services" menu item hangs, and then after that, the Services submenu appears.
This issue came from Bevy issue 14010.
macOS version
Winit version
0.30.0