diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2019-12-09 17:53:58 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2019-12-09 17:53:58 +0100 |
| commit | 0a124ac7e1b7c6210cd03ecf5d24bee2493bcc16 (patch) | |
| tree | 25b7f398a2ce66ec2ecbcf39145a46cc755439e8 | |
| parent | 61a86d194160d8c896d1f47cb8a8216625333fed (diff) | |
Fix Fl::add_timeout() in draw() under Linux (STR 3188)
Timeouts queued during Fl_Widget::draw() - called by Fl::flush() -
would not be serviced unless other events were processed. For
Details see STR 3188.
| -rw-r--r-- | CHANGES.txt | 1 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.cxx | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 6ffc7813f..2f00c254a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -105,6 +105,7 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019 Other Improvements - (add new items here) + - Fix Fl::add_timeout() in draw() under Linux (STR 3188) - Class Fl_Native_File_Chooser uses in priority the file chooser dialog of GTK version 3 when available on the running X11 platform, and falls back to version 2 when V3 is not available. In contrast, GTK version 2 was used diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index 0e1864291..75467b71b 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -480,6 +480,10 @@ double Fl_X11_Screen_Driver::wait(double time_to_wait) Fl::flush(); if (Fl::idle && !in_idle) // 'idle' may have been set within flush() time_to_wait = 0.0; + else if (first_timeout && first_timeout->time < time_to_wait) { + // another timeout may have been queued within flush(), see STR #3188 + time_to_wait = first_timeout->time >= 0.0 ? first_timeout->time : 0.0; + } return this->poll_or_select_with_delay(time_to_wait); } } |
