diff options
| -rw-r--r-- | src/Fl.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 17 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 9 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.cxx | 9 |
7 files changed, 13 insertions, 39 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 1dc8a69b7..e798166b0 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -492,8 +492,6 @@ void fl_trigger_clipboard_notify(int source) { void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions -extern int fl_wait(double time); // in Fl_<platform>.cxx - /** See int Fl::wait() */ diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index c317ef6fa..6e3bcfeef 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -839,19 +839,6 @@ static double do_queued_events( double time = 0.0 ) } -/* - * This public function handles all events. It wait a maximum of - * 'time' seconds for an event. This version returns 1 if events - * other than the timeout timer were processed. - * - * \todo there is no socket handling in this code whatsoever - */ -int fl_wait( double time ) -{ - do_queued_events( time ); - return (got_events); -} - double fl_mac_flush_and_wait(double time_to_wait) { static int in_idle = 0; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @@ -869,7 +856,9 @@ double fl_mac_flush_and_wait(double time_to_wait) { NSEnableScreenUpdates(); // 10.3 if (Fl::idle && !in_idle) // 'idle' may have been set within flush() time_to_wait = 0.0; - double retval = fl_wait(time_to_wait); + do_queued_events( time_to_wait ); + double retval = got_events; + Fl_Cocoa_Window_Driver::q_release_context(); [pool release]; return retval; diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 62ee46c2d..5bd64165f 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -369,10 +369,10 @@ static void process_awake_handler_requests(void) { // This is never called with time_to_wait < 0.0. // It *should* return negative on error, 0 if nothing happens before -// timeout, and >0 if any callbacks were done. This version only -// returns zero if nothing happens during a 0.0 timeout, otherwise -// it returns 1. -int fl_wait(double time_to_wait) { +// timeout, and >0 if any callbacks were done. This version +// always returns 1. +double Fl_WinAPI_Screen_Driver::wait(double time_to_wait) { + int have_message = 0; Fl::run_checks(); @@ -477,7 +477,7 @@ int fl_wait(double time_to_wait) { return 1; } -// just like fl_wait(0.0) except no callbacks are done: +// just like Fl_WinAPI_Screen_Driver::wait(0.0) except no callbacks are done: int Fl_WinAPI_Screen_Driver::ready() { if (PeekMessage(&fl_msg, NULL, 0, 0, PM_NOREMOVE)) return 1; if (!nfds) return 0; diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index b2fadf936..3ba9ba6bc 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -230,7 +230,7 @@ void (*fl_unlock_function)() = nothing; // This is never called with time_to_wait < 0.0: // It should return negative on error, 0 if nothing happens before // timeout, and >0 if any callbacks were done. -int fl_wait(double time_to_wait) { +int Fl_X11_Screen_Driver::poll_or_select_with_delay(double time_to_wait) { // OpenGL and other broken libraries call XEventsQueued // unnecessarily and thus cause the file descriptor to not be ready, @@ -283,7 +283,7 @@ int fl_wait(double time_to_wait) { return n; } -// just like fl_wait(0.0) except no callbacks are done: +// just like Fl_X11_Screen_Driver::poll_or_select_with_delay(0.0) except no callbacks are done: int Fl_X11_Screen_Driver::poll_or_select() { if (XQLength(fl_display)) return 1; if (!nfds) return 0; // nothing to select or poll diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index f3e50664f..7d177de98 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -27,9 +27,6 @@ #include <FL/fl_ask.H> #include <stdio.h> -// Add these externs to allow Win32 port to build - suspect that Fl_X11_Screen_Driver.cxx also might need these -// but I don't have a X11 box to hand for testing. These should be in an internal header somewhere? -extern int fl_wait(double time); // in Fl_win32.cxx // these are set by Fl::args() and override any system colors: from Fl_get_system_colors.cxx extern const char *fl_fg; @@ -267,12 +264,6 @@ void Fl_WinAPI_Screen_Driver::flush() } -double Fl_WinAPI_Screen_Driver::wait(double time_to_wait) -{ - return fl_wait(time_to_wait); -} - - extern void fl_fix_focus(); // in Fl.cxx // We have to keep track of whether we have captured the mouse, since diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H index 234f429d7..8f3638718 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.H +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -43,6 +43,7 @@ protected: FLScreenInfo screens[MAX_SCREENS]; float dpi[MAX_SCREENS][2]; int poll_or_select(); + int poll_or_select_with_delay(double time_to_wait); public: static int ewmh_supported(); diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index 9cda68eb5..05280cd79 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -48,11 +48,6 @@ extern Atom fl_NET_WORKAREA; extern XIC fl_xim_ic; // in Fl_x.cxx -// Add these externs to allow X11 port to build - same as Fl_WinAPI_Screen_Driver.cxx. -// These should be in an internal header somewhere? -// AlbrechtS (Comment by Ian, modified...) -extern int fl_wait(double time); // in Fl_x.cxx - // these are set by Fl::args() and override any system colors: from Fl_get_system_colors.cxx extern const char *fl_fg; extern const char *fl_bg; @@ -464,7 +459,7 @@ double Fl_X11_Screen_Driver::wait(double time_to_wait) time_to_wait = first_timeout->time; if (time_to_wait <= 0.0) { // do flush second so that the results of events are visible: - int ret = fl_wait(0.0); + int ret = this->poll_or_select_with_delay(0.0); Fl::flush(); return ret; } else { @@ -472,7 +467,7 @@ 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; - return fl_wait(time_to_wait); + return this->poll_or_select_with_delay(time_to_wait); } } |
