- fgSetWindow( window );
- glViewport( 0, 0, width, height );
+ SFG_Window *saved_window = fgStructure.CurrentWindow;
+
+ INVOKE_WCB( *window, Reshape, ( width, height ) );
+
+ /*
+ * Force a window redraw. In Windows at least this is only a partial
+ * solution: if the window is increasing in size in either dimension,
+ * the already-drawn part does not get drawn again and things look funny.
+ * But without this we get this bad behaviour whenever we resize the
+ * window.
+ * DN: Hmm.. the above sounds like a concern only in single buffered mode...
+ */
+ window->State.WorkMask |= GLUT_DISPLAY_WORK;
+ if( window->IsMenu )
+ fgSetWindow( saved_window );