diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-09 18:50:04 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-09 18:50:04 +0100 |
| commit | 59be6a7ef905eaf4adbe1fffd517a02ff64ae011 (patch) | |
| tree | 060f81b30d5cb95a2a87e9ae59450c96bf48cad9 | |
| parent | 36ef15963a7d90800d02110bdcf731f03659c1a6 (diff) | |
Fix for "Public members Fl::awake_ring_*_ should be private" (#559)
| -rw-r--r-- | FL/Fl.H | 3 | ||||
| -rw-r--r-- | src/Fl_lock.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 5 |
3 files changed, 14 insertions, 2 deletions
@@ -303,11 +303,14 @@ public: static void (*idle)(); #ifndef FL_DOXYGEN +private: static Fl_Awake_Handler *awake_ring_; static void **awake_data_; static int awake_ring_size_; static int awake_ring_head_; static int awake_ring_tail_; +public: + static bool equal_awake_ring_ends(); static const char* scheme_; static Fl_Image* scheme_bg_; diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index fe527ba84..3aea98d95 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -198,3 +198,11 @@ int Fl::lock() { void Fl::unlock() { Fl::system_driver()->unlock(); } + +#ifndef FL_DOXYGEN + +bool Fl::equal_awake_ring_ends() { + return awake_ring_head_ == Fl::awake_ring_tail_; +} + +#endif // FL_DOXYGEN diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index f5a671f16..e613e359e 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -491,7 +491,8 @@ double Fl_WinAPI_System_Driver::wait(double time_to_wait) { DispatchMessageW(&fl_msg); } - // The following conditional test: + // The following conditional test: !Fl::equal_awake_ring_ends() + // equivalent to: // (Fl::awake_ring_head_ != Fl::awake_ring_tail_) // is a workaround / fix for STR #3143. This works, but a better solution // would be to understand why the PostThreadMessage() messages are not @@ -511,7 +512,7 @@ double Fl_WinAPI_System_Driver::wait(double time_to_wait) { // recover and process any pending awake callbacks. // Normally the ring buffer head and tail indices will match and this // comparison will do nothing. Addresses STR #3143 - if (Fl::awake_ring_head_ != Fl::awake_ring_tail_) { + if (!Fl::equal_awake_ring_ends()) { process_awake_handler_requests(); } |
