]> git.mxchange.org Git - flightgear.git/commitdiff
Mac: Work-around for OSG3's Cocoa Viewer interacting badly with PUI
authorJames Turner <zakalawe@mac.com>
Tue, 4 Oct 2011 08:14:15 +0000 (09:14 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 4 Oct 2011 08:14:15 +0000 (09:14 +0100)
src/Main/FGEventHandler.cxx

index f6fc75c76be0d81f615bb72100b90c7a7c0d055d..950ccfd1003e01e112a6134f3865113cb2fc2aca 100644 (file)
 #define X_DOUBLE_SCROLL_BUG 1
 #endif
 
+#ifdef SG_MAC
+// hack - during interactive resize on Mac, OSG queues and then flushes
+// a large number of resize events, without doing any drawing.
+extern void puCleanUpJunk ( void ) ;
+#endif
+
 namespace flightgear
 {
 const int displayStatsKey = 1;
@@ -234,6 +240,12 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
         CameraGroup::getDefault()->resized();
         if (resizable)
           globals->get_renderer()->resize(ea.getWindowWidth(), ea.getWindowHeight());
+      #ifdef SG_MAC
+        // work around OSG Cocoa-Viewer issue with resize event handling,
+        // where resize events are queued up, then dispatched in a batch, with
+        // no interveningd drawing calls.
+        puCleanUpJunk();
+      #endif
         return true;
      case osgGA::GUIEventAdapter::CLOSE_WINDOW:
     case osgGA::GUIEventAdapter::QUIT_APPLICATION: