summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt2
-rw-r--r--FL/Fl_Tree.H3
-rw-r--r--src/Fl_Clock.cxx11
-rw-r--r--src/Fl_Pack.cxx2
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx1
5 files changed, 15 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 2f00c254a..0f9698124 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,8 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019
New Features and Extensions
- (add new items here)
+ - Fix Fl::add_timeout() under Linux (STR 3516).
+ - Fix early timeouts in Fl_Clock seen in some environments (STR 3516).
- Fl_Printer::begin_job() uses by default the Gnome print dialog on the X11
platform when the GTK library is available at run-time. That can be turned off
with Fl::option(OPTION_PRINTER_USES_GTK, false).
diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H
index 9e77faad3..6b1ab0285 100644
--- a/FL/Fl_Tree.H
+++ b/FL/Fl_Tree.H
@@ -278,7 +278,8 @@ enum Fl_Tree_Reason {
FL_TREE_REASON_NONE=0, ///< unknown reason
FL_TREE_REASON_SELECTED, ///< an item was selected
FL_TREE_REASON_DESELECTED, ///< an item was de-selected
- FL_TREE_REASON_RESELECTED, ///< an item was re-selected (e.g. double-clicked)
+ FL_TREE_REASON_RESELECTED, ///< an item was re-selected (double-clicked).
+ ///< See ::Fl_Tree_Item_Reselect_Mode to enable this.
FL_TREE_REASON_OPENED, ///< an item was opened
FL_TREE_REASON_CLOSED, ///< an item was closed
FL_TREE_REASON_DRAGGED ///< an item was dragged into a new place
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx
index ca7237212..4d7f21e47 100644
--- a/src/Fl_Clock.cxx
+++ b/src/Fl_Clock.cxx
@@ -212,11 +212,16 @@ static void tick(void *v) {
time_t sec;
int usec;
Fl::system_driver()->gettime(&sec, &usec);
+ double delta = (1000000 - usec)/1000000.; // time till next second
+ // if current time is just before full second, show that full second
+ // and wait one more second (STR 3516)
+ if (delta < 0.1) {
+ delta += 1.0;
+ sec++;
+ }
((Fl_Clock*)v)->value((ulong)sec);
- // schedule timer event slightly later than the next second (+25 ms)
- // to prevent multiple timer events if triggered too early (STR 3516)
- Fl::add_timeout((1025000 - usec)/1000000., tick, v);
+ Fl::add_timeout(delta, tick, v);
}
int Fl_Clock::handle(int event) {
diff --git a/src/Fl_Pack.cxx b/src/Fl_Pack.cxx
index 5935079ce..55ad2c385 100644
--- a/src/Fl_Pack.cxx
+++ b/src/Fl_Pack.cxx
@@ -135,6 +135,8 @@ void Fl_Pack::draw() {
th += Fl::box_dh(box()); if (th <= 0) th = 1;
if (tw != w() || th != h()) {
Fl_Widget::resize(x(),y(),tw,th);
+ Fl_Group *parent = this->parent();
+ if (parent) parent->init_sizes();
d = FL_DAMAGE_ALL;
}
if (d&FL_DAMAGE_ALL) {
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index 75467b71b..b93d22ac6 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -635,6 +635,7 @@ const char *Fl_X11_Screen_Driver::get_system_scheme()
void Fl_X11_Screen_Driver::add_timeout(double time, Fl_Timeout_Handler cb, void *argp) {
elapse_timeouts();
+ missed_timeout_by = 0;
repeat_timeout(time, cb, argp);
}