From ebbee5301b975f2afcf22a0649b3ba7724c78089 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 19 Apr 2019 13:03:49 +0200 Subject: macOS: simpler handling of GL windows when first displayed. tested on macOS versions 10.3, 10.6, 10.9, 10.14 --- src/glut_compatibility.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/glut_compatibility.cxx') 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 */ -- cgit v1.2.3