Missing shortcuts upon launch
ovanbiervliet opened this issue · 6 comments
Yeah, this one seems to be a bug in MacOS / Big Sur, which I was hoping would be resolved in a new version. If anyone has any idea how to fix this, I'd love to hear it. There was a similar issue on the gear icon (being low opacity until clicked) which I was able to fix by hiding / showing it with a timer, but I've been unable to find a fix for the shortcuts.
If you right click the Pika icon, you'll see that preferences has the shortcut straight away, so it seems to be a bug in Menu
.
I did not find anything like this, nor have I experienced it with any other app so far. Are you sure this is caused by Big Sur?
Yeah, I think the potentially "uncommon" thing is that I'm using NSWindow
with NSHostingView
, to display a SwiftUI component inside of the toolbar. That's required for it to work with 10.15. I've tried displaying it directly using .toolbar
, but it doesn't seem to play nice with NSWindow
, which is, again, a requirement for macOS 10.15. Also, .toolbar
only works with 11.
Keyboard modifiers being defined in SwiftUI only works in 11, too, which further complicates things.
I'd love if anyone knows of a solution, though, or if anyone else has come across this. There may be something else causing it, but I haven't been able to pinpoint it. At the moment those keyboard shortcuts aren't displayed in 10.15 at all, so there may be a Big Sur specific fix here that I'm missing.
Outside of my expertise 😅 the closest I got was Swift. Does this article contain any revelations? https://izziswift.com/how-do-i-add-a-toolbar-to-a-macos-app-using-swiftui/
Yeah, that's pulled from https://stackoverflow.com/questions/60464925/how-do-i-add-a-toolbar-to-a-macos-app-using-swiftui, which I've tried previous, but 10.15 compatibility / using NSWindow appears to be the underlying issue. 😞
Going to close this one as it's a Big Sur issue, but happy to reopen if anyone has any ideas on a solution.