summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Gl_Window.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index f3622508b..d77f15472 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -522,6 +522,28 @@ void Fl_Gl_Window::draw_overlay() {}
void Fl_Gl_Window::draw() {
Fl::fatal("Fl_Gl_Window::draw() *must* be overriden. Please refer to the documentation.");
}
+
+
+/**
+ Handle some FLTK events as needed.
+ */
+int Fl_Gl_Window::handle(int event)
+{
+#if (__APPLE_QUARTZ__)
+ if (event==FL_HIDE) {
+ // if we are not hidden, just the parent was hidden, so we must throw away the context
+ if (!visible_r())
+ context(0); // remove context wthout setting the hidden flags
+ }
+ if (event==FL_SHOW) {
+ // if we are not hidden, just the parent was shown, so we must create a new context
+ if (visible_r())
+ show(); //
+ }
+#endif
+ return Fl_Window::handle(event);
+}
+
//
// End of "$Id$".
//