summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-07 10:54:29 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-07 10:54:41 +0100
commit939d536b66c633b42eeddfe3dfa775e7fab0055a (patch)
treedc93d306c029e972fbf7bd0f7fd553044e035a85 /src/drivers
parent16c9641797c631caee5499f7fdd300fab714b8f8 (diff)
Fix for fltk.coredev "reentrant calls with Fl_Window::resize" - cont'd
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.cxx11
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H9
2 files changed, 20 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.cxx
index 372ee38ec..af36b1fd1 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.cxx
+++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.cxx
@@ -297,4 +297,15 @@ Fl_RGB_Image* Fl_Cocoa_Gl_Window_Driver::capture_gl_rectangle(int x, int y, int
return img;
}
+class Fl_Gl_Cocoa_Plugin : public Fl_Cocoa_Plugin {
+public:
+ Fl_Gl_Cocoa_Plugin() : Fl_Cocoa_Plugin(name()) { }
+ virtual const char *name() { return "gl.cocoa.fltk.org"; }
+ virtual void resize(Fl_Gl_Window *glw, int x, int y, int w, int h) {
+ glw->Fl_Gl_Window::resize(x, y, w, h);
+ }
+};
+
+static Fl_Gl_Cocoa_Plugin Gl_Cocoa_Plugin;
+
#endif // HAVE_GL
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
index 4bc7d3783..3003e3904 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
@@ -24,6 +24,7 @@
#define FL_COCOA_WINDOW_DRIVER_H
#include "../../Fl_Window_Driver.H"
+#include <FL/Fl_Plugin.H>
#include <ApplicationServices/ApplicationServices.h>
class Fl_Image;
@@ -163,4 +164,12 @@ public:
NSImage *icon_image;
};
+class Fl_Cocoa_Plugin : public Fl_Plugin {
+public:
+ Fl_Cocoa_Plugin(const char *pluginName) : Fl_Plugin(klass(), pluginName) { }
+ virtual const char *klass() { return "fltk:cocoa"; }
+ virtual const char *name() = 0;
+ virtual void resize(Fl_Gl_Window *glw, int x, int y, int w, int h) = 0;
+};
+
#endif // FL_COCOA_WINDOW_DRIVER_H