Detect screen resolution change errors

Francois Gouget fgouget at codeweavers.com
Fri Feb 2 09:31:02 CST 2007


Stefan Dösinger wrote:
> Am Mittwoch 31 Januar 2007 10:25 schrieb H. Verbeet:
>> On 30/01/07, Francois Gouget <fgouget at codeweavers.com> wrote:
>>> I have attached the relevant patches. Does this look ok to the DirectX
>>> gurus?
>> At least the wined3d part looks ok to me, although we should probably
>> be cleaning up the GL context as well, there and in the other places
>> where we return.
> For some reason I didn't get the original patch, or I accidentally deleted 
> it(more likely).

Yo can find it there:
http://www.winehq.org/pipermail/wine-devel/2007-January/053725.html


[...]
> I do not know to what extend we want to catch screen res change failures. The 
> resolution? I'd say yes. Color depth? Propably no because we can't change it 
> anyway. Refresh rate? Don't think its important.

There's already some code dealing with color depth issues:

   devmode.dmBitsPerPel = (bpp >= 24) ? 32 : bpp; /* Stupid XVidMode 
cannot change bpp */

But there's another place where we deal with these issues differently:

     if(devmode.dmBitsPerPel == 24) devmode.dmBitsPerPel = 32;
     [...]
     ret = ChangeDisplaySettingsExW(NULL, &devmode, NULL, 
CDS_FULLSCREEN, NULL);
     if (ret != DISP_CHANGE_SUCCESSFUL) {
         if(devmode.dmDisplayFrequency != 0) {
             WARN("ChangeDisplaySettingsExW failed, trying without the 
refresh rate\n");
             devmode.dmFields &= ~DM_DISPLAYFREQUENCY;
             devmode.dmDisplayFrequency = 0;
             ret = ChangeDisplaySettingsExW(NULL, &devmode, NULL, 
CDS_FULLSCREEN, NULL) != DISP_CHANGE_SUCCESSFUL;
         }
         if(ret != DISP_CHANGE_SUCCESSFUL) {
             return DDERR_INVALIDMODE;
         }
     }



-- 
Francois Gouget
fgouget at codeweavers.com




More information about the wine-devel mailing list