wgl: Fix running headless with Waffle on Windows
The message handling is broken when running headless. Normally, we get a WM_PAINT
right when the window is shown which causes the test to display and then exit (for -auto
usage, which is the only way they should be run when headless). But when running in a disconnected session like in a CI environment, you don't get a WM_PAINT
- and in fact you don't get any messages, meaning that the test hangs in GetMessage
. Switching that to PeekMessage
prevents the hang, but the test still doesn't actually display, unless we set need_redisplay
to true upon creation without relying on a WM_PAINT
message or a post_redisplay
from the test.
With these two changes, we can run Waffle in headless environments.