summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx27
-rw-r--r--src/Fl_Screen_Driver.cxx9
-rw-r--r--src/Fl_cocoa.mm12
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H2
4 files changed, 7 insertions, 43 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 0e1f63fc7..25b6b696f 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -516,6 +516,13 @@ double Fl::wait(double time_to_wait) {
(supposedly it would return non-zero on any errors, but FLTK calls
exit directly for these). A normal program will end main()
with return Fl::run();.
+
+ \note Fl::run() and Fl::wait() (but not Fl::wait(double)) both
+ return when all FLTK windows are closed. Therefore, a MacOS FLTK
+ application possessing Fl_Sys_Menu_Bar items able to create new windows
+ and expected to keep running without any open window cannot use
+ these two functions. One solution is to run the event loop as follows:
+ \code while (!Fl::program_should_quit()) Fl::wait(1e20); \endcode
*/
int Fl::run() {
while (Fl_X::first) wait(FOREVER);
@@ -588,26 +595,6 @@ int Fl::ready()
return screen_driver()->ready();
}
-/** Run the event loop even without any mapped window if the platform supports it.
- Identical to Fl::run() for platforms that don't support running windowless.
- The MacOS platform supports it.
- \return zero indicates the event loop has been terminated.
- \version 1.4.0
- */
-int Fl::run_also_windowless() {
- return Fl::screen_driver()->run_also_windowless();
-}
-
-/** Wait for \p delay seconds or until an event occurs, even without any mapped window if the platform supports it.
- Identical to Fl::wait(delay) for platforms that don't support running windowless.
- The MacOS platform supports it.
- \return non zero indicates the event loop should be terminated
- \version 1.4.0
- */
-int Fl::wait_also_windowless(double delay) {
- return Fl::screen_driver()->wait_also_windowless(delay);
-}
-
int Fl::program_should_quit_ = 0;
////////////////////////////////////////////////////////////////
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index 2dffcd7a5..9891721a7 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -483,15 +483,6 @@ int Fl_Screen_Driver::parse_color(const char* p, uchar& r, uchar& g, uchar& b)
return 1;
}
-int Fl_Screen_Driver::run_also_windowless() {
- return Fl::run();
-}
-
-int Fl_Screen_Driver::wait_also_windowless(double delay) {
- Fl::wait(delay);
- return Fl::first_window() != NULL;
-}
-
//
// End of "$Id$".
//
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index e83f8af4c..12e9a7bd9 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1719,18 +1719,6 @@ static void drain_dropped_files_list() {
free(fname);
}
-int Fl_Cocoa_Screen_Driver::run_also_windowless() {
- while (!Fl::program_should_quit()) {
- Fl::wait(1e20);
- }
- return 0;
-}
-
-int Fl_Cocoa_Screen_Driver::wait_also_windowless(double delay) {
- if (!Fl::program_should_quit()) Fl::wait(delay);
- return !Fl::program_should_quit();
-}
-
/*
* Install an open documents event handler...
*/
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
index 077416823..16cd246d3 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
@@ -101,8 +101,6 @@ public:
virtual float scale(int n) {return scale_;}
virtual void scale(int n, float f) { scale_ = f;}
virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h);
- virtual int run_also_windowless();
- virtual int wait_also_windowless(double delay);
private:
float scale_;
};