Fix for "Public members Fl::awake_ring_*_ should be private" (#559)

This commit is contained in:
ManoloFLTK 2022-12-09 18:50:04 +01:00
parent 36ef15963a
commit 59be6a7ef9
3 changed files with 14 additions and 2 deletions

View File

@ -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_;

View File

@ -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

View File

@ -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();
}