Browse Source

Run osx idle stuff when not embed

gh-pages
falkTX 11 years ago
parent
commit
4042431bf7
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      dgl/src/Window.cpp

+ 14
- 6
dgl/src/Window.cpp View File

@@ -80,6 +80,8 @@ public:
#elif defined(DGL_OS_LINUX) #elif defined(DGL_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
fNeedsIdle(true),
#else #else
_dummy('\0') _dummy('\0')
#endif #endif
@@ -102,6 +104,8 @@ public:
#elif defined(DGL_OS_LINUX) #elif defined(DGL_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
fNeedsIdle(true), // FIXME - set false?
#else #else
_dummy('\0') _dummy('\0')
#endif #endif
@@ -129,6 +133,8 @@ public:
#elif defined(DGL_OS_LINUX) #elif defined(DGL_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
fNeedsIdle(parentId == 0),
#else #else
_dummy('\0') _dummy('\0')
#endif #endif
@@ -241,12 +247,7 @@ public:
{ {
for (; fVisible && fModal.enabled;) for (; fVisible && fModal.enabled;)
{ {
// idle()
puglProcessEvents(fView);

if (fModal.parent != nullptr)
fModal.parent->idle();

idle();
msleep(10); msleep(10);
} }


@@ -492,6 +493,11 @@ public:
{ {
puglProcessEvents(fView); puglProcessEvents(fView);


#ifdef DGL_OS_MAC
if (fNeedsIdle)
puglImplIdle(fView);
#endif

if (fModal.enabled && fModal.parent != nullptr) if (fModal.enabled && fModal.parent != nullptr)
fModal.parent->idle(); fModal.parent->idle();
} }
@@ -713,6 +719,8 @@ private:
#elif defined(DGL_OS_LINUX) #elif defined(DGL_OS_LINUX)
Display* xDisplay; Display* xDisplay;
::Window xWindow; ::Window xWindow;
#elif defined(DGL_OS_MAC)
bool fNeedsIdle;
#else #else
char _dummy; char _dummy;
#endif #endif


Loading…
Cancel
Save