From 4042431bf71c201537fca17727de692694fc0d03 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 9 Mar 2014 18:17:57 +0000 Subject: [PATCH] Run osx idle stuff when not embed --- dgl/src/Window.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp index 477bd3b1..f991e173 100644 --- a/dgl/src/Window.cpp +++ b/dgl/src/Window.cpp @@ -80,6 +80,8 @@ public: #elif defined(DGL_OS_LINUX) xDisplay(nullptr), xWindow(0) +#elif defined(DGL_OS_MAC) + fNeedsIdle(true), #else _dummy('\0') #endif @@ -102,6 +104,8 @@ public: #elif defined(DGL_OS_LINUX) xDisplay(nullptr), xWindow(0) +#elif defined(DGL_OS_MAC) + fNeedsIdle(true), // FIXME - set false? #else _dummy('\0') #endif @@ -129,6 +133,8 @@ public: #elif defined(DGL_OS_LINUX) xDisplay(nullptr), xWindow(0) +#elif defined(DGL_OS_MAC) + fNeedsIdle(parentId == 0), #else _dummy('\0') #endif @@ -241,12 +247,7 @@ public: { for (; fVisible && fModal.enabled;) { - // idle() - puglProcessEvents(fView); - - if (fModal.parent != nullptr) - fModal.parent->idle(); - + idle(); msleep(10); } @@ -492,6 +493,11 @@ public: { puglProcessEvents(fView); +#ifdef DGL_OS_MAC + if (fNeedsIdle) + puglImplIdle(fView); +#endif + if (fModal.enabled && fModal.parent != nullptr) fModal.parent->idle(); } @@ -713,6 +719,8 @@ private: #elif defined(DGL_OS_LINUX) Display* xDisplay; ::Window xWindow; +#elif defined(DGL_OS_MAC) + bool fNeedsIdle; #else char _dummy; #endif