diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-11-24 10:35:18 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-11-24 10:35:18 +0100 |
| commit | 7e484c614c16f0a6580ba2c2efaa654ab4e08082 (patch) | |
| tree | c63843079f44f20033d4fc785119f9ab5d65474a /src/drivers/Cocoa | |
| parent | 1ce3a84e9fe74297aa764fc12536af544378d265 (diff) | |
Fix for [fltk.coredev] reentrant calls with Fl_Window::resize
Diffstat (limited to 'src/drivers/Cocoa')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H index 970d78839..6f0f11d3f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H @@ -100,6 +100,8 @@ public: void changed_resolution(bool);// sets whether window just moved to display with another resolution bool view_resized(); // did window's view receive [FLView view_did_resize] message? void view_resized(bool b); // sets whether window's view received [FLView view_did_resize] message + bool through_resize(); // did Fl_Window::resize() run already + void through_resize(bool b); // set whether Fl_Window::resize() run already CGRect* subRect() { return subRect_; } // getter void subRect(CGRect *r) { subRect_ = r; } // setter static void destroy(FLWindow*); diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 1b6205ceb..f9ba65683 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -262,6 +262,7 @@ int Fl_Cocoa_Window_Driver::scroll(int src_x, int src_y, int src_w, int src_h, i static const unsigned mapped_mask = 1; static const unsigned changed_mask = 2; static const unsigned view_resized_mask = 4; +static const unsigned through_resize_mask = 8; bool Fl_Cocoa_Window_Driver::mapped_to_retina() { return window_flags_ & mapped_mask; @@ -290,6 +291,15 @@ void Fl_Cocoa_Window_Driver::view_resized(bool b) { else window_flags_ &= ~view_resized_mask; } +bool Fl_Cocoa_Window_Driver::through_resize() { + return window_flags_ & through_resize_mask; +} + +void Fl_Cocoa_Window_Driver::through_resize(bool b) { + if (b) window_flags_ |= through_resize_mask; + else window_flags_ &= ~through_resize_mask; +} + // clip the graphics context to rounded corners void Fl_Cocoa_Window_Driver::clip_to_rounded_corners(CGContextRef gc, int w, int h) { |
