From 3036fef6a73366130cffee36e4b5515570343885 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 20 Aug 2001 19:19:18 +0000 Subject: [PATCH] Refuse to select a bitmap that is already selected in another DC. --- graphics/x11drv/bitmap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c index 5ebcc760bb8..77302053ef8 100644 --- a/graphics/x11drv/bitmap.c +++ b/graphics/x11drv/bitmap.c @@ -70,9 +70,16 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap ) X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev; if (!(dc->flags & DC_MEMORY)) return 0; - + if (hbitmap == dc->hBitmap) return hbitmap; /* nothing to do */ if (!(bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0; + if (bmp->header.dwCount) + { + WARN( "Bitmap already selected in another DC\n" ); + GDI_ReleaseObj( hbitmap ); + return 0; + } + if(!bmp->physBitmap) { if(!X11DRV_CreateBitmap(hbitmap))