summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl.cxx1
-rw-r--r--src/Fl_cocoa.mm3
-rw-r--r--src/Fl_win32.cxx4
-rw-r--r--src/Fl_x.cxx4
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx7
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx9
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx4
8 files changed, 9 insertions, 24 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 0d96142a5..1dc8a69b7 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -492,7 +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_ready(); // in Fl_<platform>.cxx
extern int fl_wait(double time); // in Fl_<platform>.cxx
/**
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 136752c4b..c317ef6fa 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -450,7 +450,8 @@ void Fl_Darwin_System_Driver::remove_fd(int n)
/*
* Check if there is actually a message pending
*/
-int fl_ready()
+int Fl_Cocoa_Screen_Driver::ready()
+
{
NSEvent *retval = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0]
inMode:NSDefaultRunLoopMode dequeue:NO];
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index bf1185f65..62ee46c2d 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -477,8 +477,8 @@ int fl_wait(double time_to_wait) {
return 1;
}
-// fl_ready() is just like fl_wait(0.0) except no callbacks are done:
-int fl_ready() {
+// just like fl_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;
timeval t;
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index a42385520..b2fadf936 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -283,8 +283,8 @@ int fl_wait(double time_to_wait) {
return n;
}
-// fl_ready() is just like fl_wait(0.0) except no callbacks are done:
-int fl_ready() {
+// just like fl_wait(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
# if USE_POLL
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
index e54f45750..a3defafcc 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
@@ -32,7 +32,6 @@
extern "C" void NSBeep(void);
extern double fl_mac_flush_and_wait(double time_to_wait);
-extern int fl_ready();
int Fl_Cocoa_Screen_Driver::next_marked_length = 0;
@@ -152,12 +151,6 @@ double Fl_Cocoa_Screen_Driver::wait(double time_to_wait)
}
-int Fl_Cocoa_Screen_Driver::ready()
-{
- return fl_ready();
-}
-
-
extern void fl_fix_focus(); // in Fl.cxx
extern void *fl_capture;
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
index 52e3f5287..f3e50664f 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx
@@ -29,7 +29,6 @@
// 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_ready(); // in Fl_win32.cxx
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
@@ -274,12 +273,6 @@ double Fl_WinAPI_Screen_Driver::wait(double time_to_wait)
}
-int Fl_WinAPI_Screen_Driver::ready()
-{
- return fl_ready();
-}
-
-
extern void fl_fix_focus(); // in Fl.cxx
// We have to keep track of whether we have captured the mouse, since
@@ -682,4 +675,4 @@ float Fl_WinAPI_Screen_Driver::desktop_scaling_factor() {
//
// End of "$Id$".
-// \ No newline at end of file
+//
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H
index 2585cb972..234f429d7 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.H
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.H
@@ -42,6 +42,7 @@ protected:
} FLScreenInfo;
FLScreenInfo screens[MAX_SCREENS];
float dpi[MAX_SCREENS][2];
+ int poll_or_select();
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 f9bae70f2..9cda68eb5 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -51,7 +51,6 @@ 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_ready(); // in Fl_x.cxx
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
@@ -452,7 +451,6 @@ double Fl_X11_Screen_Driver::wait(double time_to_wait)
reset_clock = 1; // we are not going to check the clock
}
Fl::run_checks();
- // if (idle && !fl_ready()) {
if (Fl::idle) {
if (!in_idle) {
in_idle = 1;
@@ -487,7 +485,7 @@ int Fl_X11_Screen_Driver::ready()
} else {
reset_clock = 1;
}
- return fl_ready();
+ return this->poll_or_select();
}