diff --git a/common/CocoaTools.h b/common/CocoaTools.h index 1166effc4c..8da50f8a2a 100644 --- a/common/CocoaTools.h +++ b/common/CocoaTools.h @@ -19,6 +19,8 @@ namespace CocoaTools void AddThemeChangeHandler(void* ctx, void(handler)(void* ctx)); /// Remove a handler previously added using AddThemeChangeHandler with the given context void RemoveThemeChangeHandler(void* ctx); + /// Mark an NSMenu as the help menu + void MarkHelpMenu(void* menu); /// Returns the bundle path. std::optional GetBundlePath(); /// Get the bundle path to the actual application without any translocation fun diff --git a/common/CocoaTools.mm b/common/CocoaTools.mm index 71b4c91184..adbe803b80 100644 --- a/common/CocoaTools.mm +++ b/common/CocoaTools.mm @@ -143,6 +143,11 @@ void CocoaTools::RemoveThemeChangeHandler(void* ctx) [s_themeChangeHandler removeCallback:ctx]; } +void CocoaTools::MarkHelpMenu(void* menu) +{ + [NSApp setHelpMenu:(__bridge NSMenu*)menu]; +} + // MARK: - Sound playback bool Common::PlaySoundAsync(const char* path) diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 80c05d515e..e44a0749b7 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -151,6 +151,10 @@ void MainWindow::initialize() ctx->updateTheme(); // Qt won't notice the style change without us touching the palette in some way }); }); + // The cocoa backing isn't initialized yet, delay this until stuff is set up with a `RunOnUIThread` call + QtHost::RunOnUIThread([this]{ + CocoaTools::MarkHelpMenu(m_ui.menuHelp->toNSMenu()); + }); #endif m_ui.setupUi(this); setupAdditionalUi();