Workaround xbus causing X-Plane infinite loop on OSX platforms

xbus is causing an infinite loop on OSX platforms when using
QApplication. Until this is fixed, default to QCoreApplication.
The impact is no Qt Gui can be used inside a X-Plane plugin. So
this needs to be fixed before swift gui can be bundled into one.

refs #293
This commit is contained in:
Roland Winklmeier
2015-11-10 14:16:17 +01:00
committed by Mathew Sutcliffe
parent 3f686ec017
commit 991f42ca41

View File

@@ -16,7 +16,17 @@
#define XPLM_MSG_LIVERY_LOADED 108
#endif
QSharedPointer<QApplication> g_qApp;
// Change QSharedPointer<QCoreApplication> to QSharedPointer<QApplication> below
// in case you want to have Qt Gui components inside a X-Plane plugin. The current
// default was used since QApplication causes an infinite loop in X-Plane on OSX
// platforms. X-Plane is allocating an NSApplication but never calling run(), rather
// it controls the main loop itself and pumps the event Q as needed. This causes
// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite
// loop. Since QCoreApplication is not using QCocoaEventDispatcher it works fine
// and is used as a workaround.
// See https://dev.vatsim-germany.org/issues/293 for more information.
QSharedPointer<QCoreApplication> g_qApp;
XBus::CPlugin *g_plugin;
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)