Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29184 Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- v2: Supersede 205834 and 205844~205848. Now that winex11.drv EnumDisplaySettingsW backend has a cache, performance shouldn't be an issue.
dlls/gdi32/driver.c | 19 ++++++++++++++++++- dlls/user32/tests/monitor.c | 1 - dlls/winex11.drv/init.c | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index a2ebd018bca..2042701dd45 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -460,7 +460,24 @@ static INT CDECL nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
return pGetSystemMetrics ? pGetSystemMetrics( SM_CYSCREEN ) : 480; } - case BITSPIXEL: return 32; + case BITSPIXEL: + { + DEVMODEW devmode; + WCHAR *display; + DC *dc; + + if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pEnumDisplaySettingsW) + { + dc = get_nulldrv_dc( dev ); + display = dc->display[0] ? dc->display : NULL; + memset( &devmode, 0, sizeof(devmode) ); + devmode.dmSize = sizeof(devmode); + if (pEnumDisplaySettingsW( display, ENUM_CURRENT_SETTINGS, &devmode ) + && devmode.dmFields & DM_BITSPERPEL && devmode.dmBitsPerPel) + return devmode.dmBitsPerPel; + } + return 32; + } case PLANES: return 1; case NUMBRUSHES: return -1; case NUMPENS: return -1; diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index ab03837f5e6..654f77ed617 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -2068,7 +2068,6 @@ static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_ dm->dmDisplayFrequency, value);
value = GetDeviceCaps(hdc, BITSPIXEL); - todo_wine_if(dm->dmBitsPerPel != 32) ok_(__FILE__, line)(value == dm->dmBitsPerPel, "Expected BITSPIXEL %d, got %d.\n", dm->dmBitsPerPel, value);
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index d070c0f1171..ff3d5317697 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -162,8 +162,6 @@ static INT CDECL X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap ) { switch(cap) { - case BITSPIXEL: - return screen_bpp; case SIZEPALETTE: return palette_size; default:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91489
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
user32: monitor.c:372: Test failed: ChangeDisplaySettingsA returned unexpected -2 monitor.c:377: Test failed: ChangeDisplaySettingsW returned unexpected -2 monitor.c:383: Test failed: ChangeDisplaySettingsExA returned unexpected -2 monitor.c:388: Test failed: ChangeDisplaySettingsExW returned unexpected -2 monitor.c:422: Test failed: ChangeDisplaySettingsW returned unexpected -2 monitor.c:426: Test failed: ChangeDisplaySettingsExW returned unexpected -2