http://bugs.winehq.org/show_bug.cgi?id=13481
--- Comment #6 from Rolf Neuberger rolf@neuberrosoft.de 2008-05-28 09:28:18 --- Created an attachment (id=13430) --> (http://bugs.winehq.org/attachment.cgi?id=13430) Proposed patch
... since I figured you guys are too busy with the 1.0 run-up to bother with such an obscure issue.
Patch to bring Wine CDS behaviour closer to Windows CDS behaviour. Replicates preexisting provision of a default BPP to also produce default width and height. In effect, resolution will be taken from default mode (stored in registry) when not provided in DEVMODE struct and the call goes through successfully.
The request will still be rejected and the call will fail if the CDS_UPDATEREGISTRY flag is specified. This is because the current code does not support partial writes to the default mode storage within the registry, but that's beyond the scope of this patch, and so this measure had to be taken to prevent storing a 0*0 mode as the default.
Solving this secondary issue would allow a more complete and accurate resolution.
I want to point out thought that this same secondary issue also affects default bpp and default refresh rates. Consider these two pseudo-sequences: 1) CDS(640,480,32,60,CDS_UPDATEREGISTRY) CDS(800,600,0,0,CDS_UPDATEREGISTRY)
2) CDS(640,480,16,85,CDS_UPDATEREGISTRY) CDS(800,600,0,0,CDS_UPDATEREGISTRY)
(difference is bpp and refresh in first call) You'd expect the system to keep the refresh rate and bpp settings from the first line, even if it's only a fake setting with no actual effect on the X server. However, the mode stored in the registry after both of these sequences execute is *the same* on wine-1.0-rc2. When the current code needs to provide its own (default) bpp and refresh rates (dmFields flag clear), it no longer uses the parameters as restrictions when picking a new target mode. It insteads selects the first match of only the remaining parameters, starting from the beginning of its mode list. Then it writes back *all* parameters from the mode it ended up picking into the registry. Thus the final default mode ends up being the same, even though bpp and refresh should end up different.