On 5/18/21 2:34 AM, Alexandre Julliard wrote:
Zhiyi Zhang zzhang@codeweavers.com writes:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29184 Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
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;
}
Isn't this going to be too slow? GetDeviceCaps(BITSPIXEL) can be called very frequently.
Right, please apply this after 205952. Thanks.