x11drv: extfloodfill fix

Rein Klazes wijn at wanadoo.nl
Wed Nov 23 12:47:18 CST 2005


Hi,

Fixes bug #3907

Changelog:
dlls/x11drv	: graphics.c
Handle an X-error in X11DRV_ExtFloodFill().

Rein.
-------------- next part --------------
--- wine/dlls/x11drv/graphics.c	2005-05-09 10:45:20.000000000 +0200
+++ mywine/dlls/x11drv/graphics.c	2005-11-23 19:13:52.000000000 +0100
@@ -1272,6 +1272,11 @@ static void X11DRV_InternalFloodFill(XIm
 }
 
 
+static int ExtFloodFillXGetImageErrorHandler(
+                        Display *dpy, XErrorEvent *event, void *arg)
+{
+    return (event->request_code == X_GetImage && event->error_code == BadMatch);
+}
 /**********************************************************************
  *          X11DRV_ExtFloodFill
  */
@@ -1292,10 +1297,12 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *phy
     GetRgnBox( physDev->region, &rect );
 
     wine_tsx11_lock();
+    X11DRV_expect_error( gdi_display, ExtFloodFillXGetImageErrorHandler, NULL );
     image = XGetImage( gdi_display, physDev->drawable,
                        physDev->org.x + rect.left, physDev->org.y + rect.top,
                        rect.right - rect.left, rect.bottom - rect.top,
                        AllPlanes, ZPixmap );
+    if(X11DRV_check_error()) image = NULL;
     wine_tsx11_unlock();
     if (!image) return FALSE;
 


More information about the wine-patches mailing list