Closed thisjaiden closed 10 months ago
Hi,
Thanks :)
Thanks for the report. The macOS backend is actually not implemented in Rust but in ObjC (of course there is a layer to talk with Rust) but all setup is here https://github.com/emoon/rust_minifb/tree/master/src/native/macosx
If you would be willing to have a look at this code in order to do a PR that would be awesome!
Edit: NSApp
is created here https://github.com/emoon/rust_minifb/blob/master/src/native/macosx/MacMiniFB.m#L158 to get you started.
Made a quick PR, thankfully just a two line change. Thanks for the pointer!
fixed by #335
Issue
When running
cargo run --example menu
or writing code that uses menu functionality, menus do not work until the window is deselected and re-selected. Specifically, menus show up but clicking on them does nothing. This includes both the 🍎 menu, about menu, and any user menus.Environment
rust_minifb = "0.25.0"
Things I have Found
This StackOverflow post seems to describe this issue (though not for this library or even Rust) and suggests that it's the underlying
NSApp
/AppKit
not getting fully initialized.I have a little experience with Rust and macOS FFIs, but looking at how this library and
rust-windowing/raw-window-handle
manage making anNSWindow
I have no clue how theNSApp
context is created, managed, ect. If all of that is implied by some higher level shortcut in the FFI, then it may be a macOS bug. If it's not, it may be a bug with this library or any of its dependencies. I was unsuccessful in digging any further.I'm happy to help with any hardware testing needed, and taking it to any dependencies' projects. If some indication of exactly where this initialization happens is pointed to I may be able to make a PR.
Thanks much for the great crate! :)