summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--src/glut_compatability.cxx27
2 files changed, 24 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index a07df5b26..5a5182769 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.8
+ - Fixed GLUT behavior on window creation (STR #1267)
- Fixed OS X bug that would hide tooltips before
they were shown (STR #1392)
- Fixed Fl_Tabs tooltip reappearing (STR #1324)
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 90d2d80ca..85ea3cb6d 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -42,6 +42,7 @@
#define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
+static unsigned char reshaped[MAXWINDOWS+1];
Fl_Glut_Window *glut_window;
int glut_menu;
@@ -60,8 +61,17 @@ static int indraw;
void Fl_Glut_Window::draw() {
glut_window = this;
indraw = 1;
- if (!valid()) {reshape(w(),h()); valid(1);}
- display();
+ if (!reshaped[number] ) {
+ // ignore the first show event on glutCreateWindow
+ reshaped[number] = 1;
+ } else {
+ if( !valid() || reshaped[number] == 1 ) {
+ reshaped[number] = 2;
+ reshape(w(),h());
+ valid(1);
+ }
+ display();
+ }
indraw = 0;
}
@@ -71,8 +81,17 @@ void glutSwapBuffers() {
void Fl_Glut_Window::draw_overlay() {
glut_window = this;
- if (!valid()) {reshape(w(),h()); valid(1);}
- overlaydisplay();
+ if (!reshaped[number] ) {
+ // ignore the first show event on glutCreateWindow
+ reshaped[number] = 1;
+ } else {
+ if( !valid() || reshaped[number] == 1 ) {
+ reshaped[number] = 2;
+ reshape(w(),h());
+ valid(1);
+ }
+ overlaydisplay();
+ }
}
static void domenu(int, int, int);