summaryrefslogtreecommitdiff
path: root/src/glut_compatibility.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-04-19 13:03:49 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-04-19 13:03:49 +0200
commitebbee5301b975f2afcf22a0649b3ba7724c78089 (patch)
tree89711e685a15efb557c96e8e93d6044fdb7b2f94 /src/glut_compatibility.cxx
parent698fe39ff16df2b7440df3cdbb969cba09798935 (diff)
macOS: simpler handling of GL windows when first displayed.
tested on macOS versions 10.3, 10.6, 10.9, 10.14
Diffstat (limited to 'src/glut_compatibility.cxx')
-rw-r--r--src/glut_compatibility.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glut_compatibility.cxx b/src/glut_compatibility.cxx
index 15fd07f36..24aafef58 100644
--- a/src/glut_compatibility.cxx
+++ b/src/glut_compatibility.cxx
@@ -243,14 +243,20 @@ int glutCreateWindow(const char *title) {
W->valid(0);
W->context_valid(0);
W->make_current();
+ // some platforms (e.g., macOS 10.9) draw the window while show() runs
+ // but the window's draw function is not yet set when this function runs
+ W->redraw();
return W->number;
}
int glutCreateSubWindow(int win, int x, int y, int w, int h) {
Fl_Glut_Window *W = new Fl_Glut_Window(x,y,w,h,0);
windows[win]->add(W);
- if (windows[win]->shown()) W->show();
- W->make_current();
+ if (windows[win]->shown()) {
+ W->show();
+ W->make_current();
+ W->redraw();
+ }
return W->number;
}
/** Destroys the glut window, first unregister it from the glut windows list */