x11ddraw fix

Alexandre Julliard julliard at winehq.com
Wed Nov 7 16:03:06 CST 2001


geschrader <geschrader at mediaone.net> writes:

> When X11DRV_XF86DGA2_CreatePalette( ) creates the palette
> used by  X11DRV_DDHAL_DestroyPalette( ) and
> X11DRV_DDHAL_SetPalEntries( ), the display which is used is
> returned by thread_display( ). This patch makes these two functions
> also use thread_display( ) ( rather than gdi_display ). This bug was
> causing a BadColor (i.e. invalid colormap) error in the X server
> when X11DRV_DDHAL_SetPalEntries( ) was called, followed by
> an application crash.

I think it would be better to create the palette on the gdi_display,
this way it can be manipulated by other threads too. Could you try if
this works for you?

Index: dlls/x11drv/dga2.c
===================================================================
RCS file: /opt/cvs-commit/wine/dlls/x11drv/dga2.c,v
retrieving revision 1.5
diff -u -r1.5 dga2.c
--- dlls/x11drv/dga2.c	2001/09/11 00:32:33	1.5
+++ dlls/x11drv/dga2.c	2001/11/07 20:28:34
@@ -174,8 +174,8 @@
 
 static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data)
 {
-  Display *display = thread_display();
-  data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(display, DefaultScreen(display), dga_dev, AllocAll);
+  data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(gdi_display, DefaultScreen(gdi_display),
+                                                           dga_dev, AllocAll);
   if (data->lpColorTable)
     X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256,
 			       data->lpColorTable);
@@ -199,10 +199,9 @@
 
 static DWORD PASCAL X11DRV_XF86DGA2_SetPalette(LPDDHAL_SETPALETTEDATA data)
 {
-  Display *display = thread_display();
   if ((data->lpDDSurface == X11DRV_DD_Primary) &&
       data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) {
-    TSXDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1);
+    TSXDGAInstallColormap(gdi_display, DefaultScreen(gdi_display), data->lpDDPalette->u1.dwReserved1);
   }
   data->ddRVal = DD_OK;
   return DDHAL_DRIVER_HANDLED;

-- 
Alexandre Julliard
julliard at winehq.com




More information about the wine-devel mailing list