summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-12-14 01:25:21 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-12-14 01:25:21 +0000
commitcbb4918f4134ae98926d8fd79746a43d50e76fd5 (patch)
tree9a52ddc6ef28eef18e04a90416a0d18b8f7b34f5 /src
parentf4b83b81ba48fcf013717e8b383df6d7720fe9ca (diff)
Change FOREVER back to 1e20 (minimal CPU usage) and change fl_wait()
implementation on WIN32 to check for idle and to use a time_to_wait() of 0... (STR #1120) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4704 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx2
-rw-r--r--src/Fl_win32.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index d999b0712..5035e3a87 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -449,7 +449,7 @@ double Fl::wait(double time_to_wait) {
#endif
}
-#define FOREVER 0.01 //1e20
+#define FOREVER 1e20
int Fl::run() {
while (Fl_X::first) wait(FOREVER);
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index cf0d72772..8b21fe0e3 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -257,6 +257,8 @@ int fl_wait(double time_to_wait) {
}
#endif // USE_ASYNC_SELECT
+ if (Fl::idle) time_to_wait = 0.0;
+
fl_unlock_function();
time_to_wait = (time_to_wait > 10000 ? 10000 : time_to_wait);