1
0
Fork 0

Fix missing menubar on Mac in some setups

- Only clear the OSG ‘pose as standalone’ flag when we really show
  a dialog, as opposed to when we /might/ show.

Tested:
 - Qt build using launcher
 - No Qt build 
 - Qt build but launcher not requested
This commit is contained in:
James Turner 2016-03-19 14:46:11 +00:00
parent e1bb47bc89
commit 74f17d2882
3 changed files with 11 additions and 6 deletions

View file

@ -357,10 +357,6 @@ void initApp(int& argc, char** argv)
::setlocale(LC_NUMERIC, "C");
::setlocale(LC_COLLATE, "C");
// avoid double Apple menu and other weirdness if both Qt and OSG
// try to initialise various Cocoa structures.
flightgear::WindowBuilder::setPoseAsStandaloneApp(false);
Qt::KeyboardModifiers mods = app->queryKeyboardModifiers();
if (mods & (Qt::AltModifier | Qt::ShiftModifier)) {
qWarning() << "Alt/shift pressed during launch";
@ -427,6 +423,10 @@ bool runLauncherDialog()
loadNaturalEarthData();
// avoid double Apple menu and other weirdness if both Qt and OSG
// try to initialise various Cocoa structures.
flightgear::WindowBuilder::setPoseAsStandaloneApp(false);
QtLauncher dlg;
dlg.show();

View file

@ -40,6 +40,7 @@
#include <Main/fg_init.hxx>
#include <Main/options.hxx>
#include <Include/version.h>
#include <Viewer/WindowBuilder.hxx>
SetupRootDialog::SetupRootDialog(PromptState prompt) :
QDialog(),
@ -76,6 +77,10 @@ bool SetupRootDialog::runDialog(bool usingDefaultRoot)
bool SetupRootDialog::runDialog(PromptState prompt)
{
// avoid double Apple menu and other weirdness if both Qt and OSG
// try to initialise various Cocoa structures.
flightgear::WindowBuilder::setPoseAsStandaloneApp(false);
SetupRootDialog dlg(prompt);
dlg.exec();
if (dlg.result() != QDialog::Accepted) {

View file

@ -25,7 +25,7 @@
#include <sstream>
#if defined(HAVE_QT) && defined(SG_MAC)
#if defined(SG_MAC)
#include <osgViewer/api/Cocoa/GraphicsWindowCocoa>
#endif
@ -253,7 +253,7 @@ GraphicsWindow* WindowBuilder::getDefaultWindow()
= new GraphicsContext::Traits(*defaultTraits);
traits->windowName = "FlightGear";
#if defined(HAVE_QT) && defined(SG_MAC)
#if defined(SG_MAC)
int flags = osgViewer::GraphicsWindowCocoa::WindowData::CheckForEvents;
// avoid both QApplication and OSG::CocoaViewer doing single-application