Commit eaeef1de authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Use current mode position if desired mode doesn't specify it.

parent f60716c9
......@@ -2060,12 +2060,17 @@ static DEVMODEW *validate_display_settings( const WCHAR *adapter_path, const WCH
return NULL;
}
if (!is_detached_mode( devmode ) && (!devmode->dmPelsWidth || !devmode->dmPelsHeight))
if (!is_detached_mode( devmode ) && (!devmode->dmPelsWidth || !devmode->dmPelsHeight || !(devmode->dmFields & DM_POSITION)))
{
DEVMODEW current_mode = {.dmSize = sizeof(DEVMODEW)};
if (!user_driver->pGetCurrentDisplaySettings( device_name, &current_mode )) return NULL;
if (!devmode->dmPelsWidth) devmode->dmPelsWidth = current_mode.dmPelsWidth;
if (!devmode->dmPelsHeight) devmode->dmPelsHeight = current_mode.dmPelsHeight;
if (!(devmode->dmFields & DM_POSITION))
{
devmode->dmPosition = current_mode.dmPosition;
devmode->dmFields |= DM_POSITION;
}
}
return devmode;
......
......@@ -498,16 +498,6 @@ static LONG get_display_settings(DEVMODEW **new_displays, const WCHAR *dev_name,
else if (!wcsicmp(dev_name, display_device.DeviceName))
{
*mode = *dev_mode;
if (!(dev_mode->dmFields & DM_POSITION))
{
memset(&current_mode, 0, sizeof(current_mode));
current_mode.dmSize = sizeof(current_mode);
if (!NtUserEnumDisplaySettings( &device_name, ENUM_CURRENT_SETTINGS, &current_mode, 0 ))
goto done;
mode->dmFields |= DM_POSITION;
mode->dmPosition = current_mode.dmPosition;
}
}
else
{
......
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