Commit 8f45d9a9 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Wait for graphics driver to be ready in EnumDisplayDevicesW.

It's possible that EnumDisplayDevicesW gets called before graphics driver is loaded. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ed6aa17d
......@@ -736,6 +736,18 @@ static void release_display_device_init_mutex( HANDLE mutex )
CloseHandle( mutex );
}
/* Wait until graphics driver is loaded by explorer */
static void wait_graphics_driver_ready(void)
{
static BOOL ready = FALSE;
if (!ready)
{
SendMessageW( GetDesktopWindow(), WM_NULL, 0, 0 );
ready = TRUE;
}
}
/* map value from system dpi to standard 96 dpi for storing in the registry */
static int map_from_system_dpi( int val )
{
......@@ -4048,6 +4060,7 @@ BOOL WINAPI EnumDisplayDevicesW( LPCWSTR device, DWORD index, DISPLAY_DEVICEW *i
TRACE("%s %d %p %#x\n", debugstr_w( device ), index, info, flags);
wait_graphics_driver_ready();
mutex = get_display_device_init_mutex();
/* Find adapter */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment