From: R��mi Bernon rbernon@codeweavers.com
--- dlls/win32u/sysparams.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index aa644d9931d..07016bd7acb 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -548,6 +548,7 @@ static BOOL write_registry_settings( const WCHAR *adapter_path, const DEVMODEW *
static int mode_compare(const void *p1, const void *p2) { + BOOL a_interlaced, b_interlaced, a_stretched, b_stretched; DWORD a_width, a_height, b_width, b_height; const DEVMODEW *a = p1, *b = p2; int ret; @@ -575,6 +576,16 @@ static int mode_compare(const void *p1, const void *p2) b_height = b->dmPelsWidth; }
+ if (!(a->dmFields & DM_DISPLAYFLAGS)) a_interlaced = FALSE; + else a_interlaced = !!(a->dmDisplayFlags & DM_INTERLACED); + if (!(b->dmFields & DM_DISPLAYFLAGS)) b_interlaced = FALSE; + else b_interlaced = !!(b->dmDisplayFlags & DM_INTERLACED); + + if (!(a->dmFields & DM_DISPLAYFIXEDOUTPUT)) a_stretched = FALSE; + else a_stretched = a->dmDisplayFixedOutput == DMDFO_STRETCH; + if (!(b->dmFields & DM_DISPLAYFIXEDOUTPUT)) b_stretched = FALSE; + else b_stretched = b->dmDisplayFixedOutput == DMDFO_STRETCH; + /* Depth in descending order */ if ((ret = b->dmBitsPerPel - a->dmBitsPerPel)) return ret;
@@ -590,6 +601,12 @@ static int mode_compare(const void *p1, const void *p2) /* Orientation in ascending order */ if ((ret = a->dmDisplayOrientation - b->dmDisplayOrientation)) return ret;
+ /* Interlaced in ascending order */ + if ((ret = a_interlaced - b_interlaced)) return ret; + + /* Stretched in ascending order */ + if ((ret = a_stretched - b_stretched)) return ret; + return 0; }
@@ -2110,6 +2127,12 @@ static DEVMODEW *find_display_mode( DEVMODEW *modes, DEVMODEW *devmode ) continue; if ((devmode->dmFields & DM_DISPLAYORIENTATION) && devmode->dmDisplayOrientation != mode->dmDisplayOrientation) continue; + if ((devmode->dmFields & DM_DISPLAYFLAGS) && (mode->dmFields & DM_DISPLAYFLAGS) && + (devmode->dmDisplayFlags & DM_INTERLACED) != (mode->dmDisplayFlags & DM_INTERLACED)) + continue; + if ((devmode->dmFields & DM_DISPLAYFIXEDOUTPUT) && (mode->dmFields & DM_DISPLAYFIXEDOUTPUT) && + devmode->dmDisplayFixedOutput != mode->dmDisplayFixedOutput) + continue;
return mode; }