On Thu Sep 15 10:06:09 2022 +0000, Zhiyi Zhang wrote:
How did you test it? And what's the Windows version and GPU? I used the following code to change the resolution. And I setup spy++ beforehand to monitor WM_DISPLAYCHANGE. I tried the test on Windows 10 21H2 and Windows 11 in VirtualBox, also Windows 10 on a real machine with an AMD Vega GPU. `
DEVMODEW devmode;
memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); devmode.dmPelsWidth = 1024; devmode.dmPelsHeight = 768; devmode.dmBitsPerPel = 16; devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; ChangeDisplaySettingsExW(NULL, &devmode, 0, CDS_RESET, NULL); memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(devmode); EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &devmode, 0); printf("depth %d\n", devmode.dmBitsPerPel); ` Anyway, this seems like the opportunity to make the tests more reliable if you're going to change the code.
I cleaned up the tests a bit, but they mostly work in the same way as before, and on all the testbot VMs where changing to 8, 16 or 24 bit bpp (there's a w7 where it works), the `WM_DISPLAYCHANGE` message has the requested bpp.
Then, when changing back to the default 32bpp, most of the time no `WM_DISPLAYCHANGE` message is received, though it's a bit inconsistent there.