summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-03-05 08:46:30 +0000
committerManolo Gouy <Manolo>2012-03-05 08:46:30 +0000
commitc36a9992e30f12f2ad1698718d6a2d12266a9e76 (patch)
tree892df8c54ae2a3310e14a8028780a2087fa025d8
parent4e3f9e2ab3cbaa47d433e70c1768bdf3986624ff (diff)
Fix STR #2260: OpenGL windows in Fl_Tabs don't hide when tabs are switched (Mac only)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9264 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Gl_Window.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 1a61df768..b9bf61096 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -20,6 +20,9 @@
#if HAVE_GL
extern int fl_gl_load_plugin;
+#ifdef __APPLE__
+extern void gl_texture_reset();
+#endif
static int temp = fl_gl_load_plugin;
@@ -167,6 +170,10 @@ void Fl_Gl_Window::make_current() {
context_ = fl_create_gl_context(this, g);
valid(0);
context_valid(0);
+#ifdef __APPLE__
+ // resets the pile of string textures used to draw strings
+ gl_texture_reset();
+#endif
}
fl_set_gl_context(this, context_);
@@ -462,11 +469,6 @@ void Fl_Gl_Window::hide() {
Fl_Gl_Window::~Fl_Gl_Window() {
hide();
// delete overlay; this is done by ~Fl_Group
-#ifdef __APPLE__
- // resets the pile of string textures used to draw strings
- extern void gl_texture_reset();
- gl_texture_reset();
-#endif
}
void Fl_Gl_Window::init() {
@@ -533,7 +535,7 @@ void Fl_Gl_Window::draw() {
int Fl_Gl_Window::handle(int event)
{
#ifdef __APPLE_QUARTZ__
- /*if (event==FL_HIDE) {
+ 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 without setting the hidden flags
@@ -542,7 +544,7 @@ int Fl_Gl_Window::handle(int event)
// 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);
}