1

Working with a double-buffered window, I have a problem that when I make my parent window fullscreen (just covering the whole screen using the method in this answer, or using ChangeDisplaySettings with CDS_FULLSCREEN both show the problem), any child windows it has are not drawn/visible. However, this only happens if the window has focus / is the active window. I have been banging my head against this for a very long time (2+ years) and have finally started caring enough to try and figure this out.

Specific setup:

  • This is an OpenGL window, double-buffered
  • Parent is drawn before child is drawn and both are receiving WM_PAINT messages
  • Drawing is done outside WM_PAINT BeginPaint/EndPaint pairs by simply making the Device Context of the window to draw current. However, an older version of the code did confine all drawing to inside Begin-/EndPaint, and I had the same problem.
  • Parent window styles when fullscreen, as given by WinSpy++ (consistent with what i request in code): WS_OVERLAPPEDWINDOW, WS_VISIBLE, WSCLIPSIBLINGS, WS_CLIPCHILDREN (though caption removed by this method and is indeed not present, seems winspy doesn't show this), no active WS_EX styles
  • Child window: WS_CHILD, WS_VISIBLE, WSCLIPSIBLINGS, WS_CLIPCHILDREN, no WS_EX
  • Code handling WM_SETFOCUS: DefWindowProc() for return value of my window proc, SetActiveWindow(), UpdateWindow()
  • Code handling WM_KILLFOCUS: only DefWindowProc() for return value of my window proc
  • WM_ACTIVATE is passed to DefWindowProc().
  • I have seen this problem on at least windows 7 and 8, with various versions of MSVC and the windows SDK.
  • Is there any other info i can add?

Lastly, this concerns the code of FreeGLUT, try the resizer demo in svn trunk should you want to see the problem in action. After starting the demo, press c to open a child window, and then f to make things fullscreen.

Community
  • 1
  • 1
  • After downloading the 2.8.1 tarball and building the freeglut and Resizer projects, I must say that I cannot reproduce your problem. I can open/close the child window which remains visible when in fullscreen. Only customization was switching to the platform toolset v100 in both projects. – Gunther Van Butsele Oct 28 '14 at 08:55
  • @GuntherVanButsele, thanks for trying it out. I had these problems back with 2.8.1 already, but would you mind trying out 3.0 that is currently in [svn trunk](http://freeglut.sourceforge.net/help.php#svn) only? – Diederick C. Niehorster Oct 28 '14 at 14:07

0 Answers0