mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Merge branch 'master' of https://github.com/fltk/fltk
This commit is contained in:
@@ -18,6 +18,8 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019
|
|||||||
New Features and Extensions
|
New Features and Extensions
|
||||||
|
|
||||||
- (add new items here)
|
- (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
|
- 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
|
platform when the GTK library is available at run-time. That can be turned off
|
||||||
with Fl::option(OPTION_PRINTER_USES_GTK, false).
|
with Fl::option(OPTION_PRINTER_USES_GTK, false).
|
||||||
|
|||||||
+8
-3
@@ -212,11 +212,16 @@ static void tick(void *v) {
|
|||||||
time_t sec;
|
time_t sec;
|
||||||
int usec;
|
int usec;
|
||||||
Fl::system_driver()->gettime(&sec, &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);
|
((Fl_Clock*)v)->value((ulong)sec);
|
||||||
|
|
||||||
// schedule timer event slightly later than the next second (+25 ms)
|
Fl::add_timeout(delta, tick, v);
|
||||||
// to prevent multiple timer events if triggered too early (STR 3516)
|
|
||||||
Fl::add_timeout((1025000 - usec)/1000000., tick, v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl_Clock::handle(int event) {
|
int Fl_Clock::handle(int event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user