#147 Window not updated after menu close

moderate (59)

When a menu is closed the parent window is only updated in the region of the menu after the close on Win7 64bit. I was able to fix the problem by invalidating the parent window after the menu window is hidden:

(FILE freeglut_menu.c)
void fgDeactivateMenu( SFG_Window *window )


fgSetWindow ( parent_window ) ;
InvalidateRect( parent_window->Window.Handle, NULL, FALSE); // Adding this fixes the issue

Not sure if this is the best place to put the fix but hope you can add this in the appropriate way.



  • Diederick C. Niehorster

    Hi Timo,

    Thanks for the report. Could you try putting:
    InvalidateRect( hWnd, NULL, GL_FALSE ); /* Make sure whole window is repainted. Bt of a hack, but a safe on from what google turns up... */
    in freeglut_main.c, before the BeginPaint in the WM_PAINT handler of fgWindowProc, and see if this fixes it as well (don't forget to take out your othter fix first and then verify you still see the old problem.

    Sorry for catching this late, but wanna stamp this one out now. Can't reproduce it myself though...


  • Diederick C. Niehorster

    If it doesn't do the trick, try adding
    parent_window->State.Redisplay = GL_TRUE;
    below the fgSetWindow ( parent_window ), instead of the InvalidateREct you put there, but keep the InvalidateRect in the WM_PAINT handler i suggested. Does it do the trick then?

  • Diederick C. Niehorster

    • status: open --> closed
  • Diederick C. Niehorster

    marked as closed due to inactivity. The WM_PAINT handler now has an InvalidateRect() as suggested in earlier comments


Log in to post a comment.