From 511aee9d3a8a08c52996d340dc05557dde2789fd Mon Sep 17 00:00:00 2001 From: SteveMcNeill Date: Fri, 2 Nov 2018 08:04:39 -0400 Subject: [PATCH] Fix to _SCREENMOVE _MIDDLE Requesting state for an invalid GLUT state name returns negative one... So, we start with a -1 and wait until GLUT has initialized our window and registered it with the OS all properly, and then use the proper return value to move the window to the middle of the screen. --- internal/c/libqb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index f17b95401..d08337529 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -24860,8 +24860,8 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ if (passed==2){ glutPositionWindow (x,y);} else{ - int32 SW, SH, WW, WH; - SW = glutGet(GLUT_SCREEN_WIDTH); + int32 SW=-1, SH, WW, WH; + while (SW==-1){SW = glutGet(GLUT_SCREEN_WIDTH);} SH = glutGet(GLUT_SCREEN_HEIGHT); WW = glutGet(GLUT_WINDOW_WIDTH); WH = glutGet(GLUT_WINDOW_HEIGHT);