[PATCH 3/6] winex11.drv: Allow setting a 0bit color depth display mode.
Zhiyi Zhang
zzhang at codeweavers.com
Tue Aug 25 02:16:51 CDT 2020
Windows 8.1 and older allow setting a display mode with 0bit color depth.
Fix a regression from 981fb4edb371dd2ccf57dd350e76451df50c0a98.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
This is already tested in user32/tests/monitor.c#test_ChangeDisplaySettingsEx() vid_modes_test[3].
But the test is marked as not must succeed because different Windows versions may return different results.
So the TestBots didn't catch this one.
dlls/winex11.drv/settings.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c
index 7827ede6560..902f1ec15d9 100644
--- a/dlls/winex11.drv/settings.c
+++ b/dlls/winex11.drv/settings.c
@@ -473,7 +473,9 @@ static DEVMODEW *get_full_mode(ULONG_PTR id, DEVMODEW *dev_mode)
{
found_mode = (DEVMODEW *)((BYTE *)modes + (sizeof(*modes) + modes[0].dmDriverExtra) * mode_idx);
- if (dev_mode->dmFields & DM_BITSPERPEL && found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel)
+ if (dev_mode->dmFields & DM_BITSPERPEL &&
+ dev_mode->dmBitsPerPel &&
+ found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel)
continue;
if (dev_mode->dmFields & DM_PELSWIDTH && found_mode->dmPelsWidth != dev_mode->dmPelsWidth)
continue;
--
2.25.1
More information about the wine-devel
mailing list