views:

274

answers:

1

Hi,

It seems that my problem may be the same as an unanswered related question (OpenGL with GLUT on windows 7, fullscreen mode not showing the message box).

Since I switched to Win7 as a development environment, and a possible target platform for my applications, I noticed a regression in their behaviour.

Whenever I have a fullscreen window containing a fullscreen OpenGL context, the applications have problems displaying modal dialog boxes (such as message boxes, file open dialog, etc.)

The window is just created with WS_POPUP style. The GL context is nothing fancy. And everything is fine with Windows XP.

The problem under Windows 7 is that the modal dialog boxes are invisible at their opening (maybe their appear behind the full screen window). You have to Alt-Tab the application to have the dialogs appear.

This is a major problem as the application appears to be frozen, while it in fact waits for user input.

Did anyone encounter this behaviour ? Does anyone know a workaround ?

I've quickly made up a sample test application ; its source code can be found at http://pastebin.com/K4v2NNDs. A simple MSVC8 project can be found here.

Cheers.

PS. I've also posted on opengl.org forums, sorry for those of you that follow both.

EDIT

Thanks to Chris comment, I've tested the modal dialog on various events, such as WM_TIMER or WM_RBUTTONUP, but the problem is still there.

I've also called 'DwmEnableComposition' with 'DWM_EC_DISABLECOMPOSITION' just to check : problem still there.

I've also tested the application by replacing the OpenGL bits by DirectX, and this way everything works as expected... It's really OpenGL causing the problem.

(updated pastebin http://pastebin.com/Rq1Ehm3w and my scratchpad)

+1  A: 

A workaround has been posted on opengl.org by Joseph Steel, so, for reference I put it here as well :

The solution I found for this problem was to ensure that the pixel format for the window uses the WGL_SWAP_COPY_ARB swap method rather than the WGL_SWAP_EXCHANGE_ARB.

I've noted that one must use 'wglChoosePixelFormatARB' to obtain the pixel format.

I tried with the classic 'ChoosePixelFormat' with the 'PFD_SWAP_COPY' flag, but it does not work on my system (Win7 x64 + NVidia GeFo 9600GT v196.21) as it always returns me a pixel format with 'PFD_SWAP_EXCHANGE' instead.

I'm only half-happy with the results, as it introduces some tearing in my display, but as least it works !

For reference, I've updated my test source code.

rotoglup
Just not to leave this question, i'll accept my own answer..
rotoglup
I thought I was the only person having this problem. Thanks for posting a work around. It's a shame that this still hasn't been resolved by the driver vendors.
flashk