PATCH: GetDevCaps() bitdepth flag

Tony Lambregts tony.lambregts at gmail.com
Fri Mar 17 19:33:19 CST 2006


pagefault wrote:
> Hi there, I work on ZSNES and I was trying to get it working under
> wine and I ran into a small bug when running under a 32 bit desktop.
> 
> This fixed a bug in the DeviceGetCaps() function used to return the
> current bitdepth of the desktop. It is my understanding that X11
> returns "24" as the bitdepth while running a 32 bit framebuffer. I
> have seen in the code where it does change the 24 to 32, but I have
> discovered a spot where this has been missed.
> 
> The following is the changes I made, it simply returns 32 if the user
> has a 24 bit desktop.
> 
> I could also post code which exposes this bug if needed.
> 
> *** dlls/x11drv/init.c	2006-03-17 13:05:59.000000000 -0500
> --- dlls/x11drv/init.diff	2006-03-17 12:18:05.000000000 -0500
> ***************
> *** 190,196 ****
>       case VERTRES:
>           return screen_height;
>       case BITSPIXEL:
> !         return screen_depth;
>       case PLANES:
>           return 1;
>       case NUMBRUSHES:
> --- 190,196 ----
>       case VERTRES:
>           return screen_height;
>       case BITSPIXEL:
> !         return (screen_depth == 24) ? 32 : screen_depth;
>       case PLANES:
>           return 1;
>       case NUMBRUSHES:
> 
> 
> 
> Thanks.
> 
> 
>
does this actually fix it so that some program works that did not before?

I'm not the expert for this area (X-11) but here are a couple of comments.
Patches for wine are in "diff -u format and if you want it included to wine it 
is best submit it to wine-patches at winehq.org with a change log. IE:

Change log: Fix GetDevCaps for 32 bit screen depth.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: init.diff
Type: text/x-patch
Size: 530 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060317/2af91550/init.diff


More information about the wine-devel mailing list