diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index 5dbef14..18be628 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -349,6 +349,19 @@ void Fractorium::resizeEvent(QResizeEvent* e) QMainWindow::resizeEvent(e); } +/// +/// Respond to a show event to ensure Qt updates the native menubar. +/// On first create, Qt can fail to create the native menu bar properly, +/// but telling it that this window has become the focus window forces +/// it to refresh this. +/// The event +void Fractorium::showEvent(QShowEvent *e) +{ + // tell Qt to refresh the native menubar from this widget + emit qGuiApp->focusWindowChanged(windowHandle()); + QMainWindow::showEvent(e); +} + /// /// Stop rendering and block before exiting. /// Called on program exit. diff --git a/Source/Fractorium/Fractorium.h b/Source/Fractorium/Fractorium.h index 874b472..6de433b 100644 --- a/Source/Fractorium/Fractorium.h +++ b/Source/Fractorium/Fractorium.h @@ -306,6 +306,7 @@ protected: virtual void dragEnterEvent(QDragEnterEvent* e) override; virtual void dragMoveEvent(QDragMoveEvent* e) override; virtual void dropEvent(QDropEvent* e) override; + virtual void showEvent(QShowEvent *e) override; private: void InitMenusUI();