summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index d67235e9f..c8584707e 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.cxx,v 1.24.2.27 2000/06/18 00:38:39 bill Exp $"
+// "$Id: Fl.cxx,v 1.24.2.28 2000/06/20 05:47:36 bill Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -132,7 +132,6 @@ static void elapse_timeouts() {
}
static char in_idle;
-static char in_timeout;
double Fl::wait(double time_to_wait) {
if (numtimeouts) {
@@ -148,9 +147,7 @@ double Fl::wait(double time_to_wait) {
if (numtimeouts)
memmove(timeout, timeout+1, numtimeouts*sizeof(Timeout));
// Now it is safe for the callback to do add_timeout:
- in_timeout = 1;
cb(arg);
- in_timeout = 0;
}
} else {
reset_clock = 1; // we are not going to check the clock
@@ -200,12 +197,11 @@ int Fl::ready() {
}
void Fl::add_timeout(double t, Fl_Timeout_Handler cb, void *v) {
+ elapse_timeouts();
+ add_interval_timeout(t, cb, v);
+}
- // This little test gets rid of about half the calls to get the time
- // and has the added advantage of making timeouts that think they
- // are happening at regular intervals actually happen at regular
- // intervals:
- if (!in_timeout) elapse_timeouts();
+void Fl::add_interval_timeout(double t, Fl_Timeout_Handler cb, void *v) {
if (numtimeouts >= timeout_array_size) {
timeout_array_size = 2*timeout_array_size+1;
@@ -733,5 +729,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.27 2000/06/18 00:38:39 bill Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.28 2000/06/20 05:47:36 bill Exp $".
//