All pastes #778688 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-17 20:50 UTC
rendered paste body
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 4bb44f2..fd13481 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -182,7 +182,8 @@ BOOL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev )
  *           GetDeviceCaps    (X11DRV.@)
  */
 INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
-{
+{  
+    char name[3];
     switch(cap)
     {
     case DRIVERVERSION:
@@ -202,7 +203,8 @@ INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
     case DESKTOPVERTRES:
         return virtual_screen_rect.bottom - virtual_screen_rect.top;
     case BITSPIXEL:
-        return screen_depth;
+        /*Only 32,24 will work, other values/string will crash wine!!!*/
+        return !GetEnvironmentVariableA("WDEPTH",name,sizeof(name)) ? screen_depth : atoi(name);
     case PLANES:
         return 1;
     case NUMBRUSHES: