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:
parent
e1bb47bc89
commit
74f17d2882
3 changed files with 11 additions and 6 deletions
|
@ -357,10 +357,6 @@ void initApp(int& argc, char** argv)
|
||||||
::setlocale(LC_NUMERIC, "C");
|
::setlocale(LC_NUMERIC, "C");
|
||||||
::setlocale(LC_COLLATE, "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();
|
Qt::KeyboardModifiers mods = app->queryKeyboardModifiers();
|
||||||
if (mods & (Qt::AltModifier | Qt::ShiftModifier)) {
|
if (mods & (Qt::AltModifier | Qt::ShiftModifier)) {
|
||||||
qWarning() << "Alt/shift pressed during launch";
|
qWarning() << "Alt/shift pressed during launch";
|
||||||
|
@ -427,6 +423,10 @@ bool runLauncherDialog()
|
||||||
|
|
||||||
loadNaturalEarthData();
|
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;
|
QtLauncher dlg;
|
||||||
dlg.show();
|
dlg.show();
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include <Main/fg_init.hxx>
|
#include <Main/fg_init.hxx>
|
||||||
#include <Main/options.hxx>
|
#include <Main/options.hxx>
|
||||||
#include <Include/version.h>
|
#include <Include/version.h>
|
||||||
|
#include <Viewer/WindowBuilder.hxx>
|
||||||
|
|
||||||
SetupRootDialog::SetupRootDialog(PromptState prompt) :
|
SetupRootDialog::SetupRootDialog(PromptState prompt) :
|
||||||
QDialog(),
|
QDialog(),
|
||||||
|
@ -76,6 +77,10 @@ bool SetupRootDialog::runDialog(bool usingDefaultRoot)
|
||||||
|
|
||||||
bool SetupRootDialog::runDialog(PromptState prompt)
|
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);
|
SetupRootDialog dlg(prompt);
|
||||||
dlg.exec();
|
dlg.exec();
|
||||||
if (dlg.result() != QDialog::Accepted) {
|
if (dlg.result() != QDialog::Accepted) {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#if defined(HAVE_QT) && defined(SG_MAC)
|
#if defined(SG_MAC)
|
||||||
#include <osgViewer/api/Cocoa/GraphicsWindowCocoa>
|
#include <osgViewer/api/Cocoa/GraphicsWindowCocoa>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ GraphicsWindow* WindowBuilder::getDefaultWindow()
|
||||||
= new GraphicsContext::Traits(*defaultTraits);
|
= new GraphicsContext::Traits(*defaultTraits);
|
||||||
traits->windowName = "FlightGear";
|
traits->windowName = "FlightGear";
|
||||||
|
|
||||||
#if defined(HAVE_QT) && defined(SG_MAC)
|
#if defined(SG_MAC)
|
||||||
int flags = osgViewer::GraphicsWindowCocoa::WindowData::CheckForEvents;
|
int flags = osgViewer::GraphicsWindowCocoa::WindowData::CheckForEvents;
|
||||||
|
|
||||||
// avoid both QApplication and OSG::CocoaViewer doing single-application
|
// avoid both QApplication and OSG::CocoaViewer doing single-application
|
||||||
|
|
Loading…
Add table
Reference in a new issue