winex11: Make sure the cursor bitmaps are owned by x11drv.
authorAlexandre Julliard <julliard@winehq.org>
Wed, 14 Sep 2011 12:53:59 +0000 (14:53 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 14 Sep 2011 12:53:59 +0000 (14:53 +0200)
dlls/winex11.drv/mouse.c

index d70f152ce381f9da857497289247f1b141f4a68d..0ba57d195bd0b8eebc6911bccca852aaa0968c7e 100644 (file)
@@ -1081,6 +1081,11 @@ static Cursor create_xlib_cursor( HDC hdc, const ICONINFOEXW *icon, int width, i
 
     if (has_alpha)
     {
+        /* make sure the bitmaps are owned by x11drv */
+        HBITMAP orig = SelectObject( hdc, icon->hbmMask );
+        SelectObject( hdc, xor_bitmap );
+        SelectObject( hdc, orig );
+
         memset( mask_bits, 0, width_bytes * height );
         for (y = 0, ptr = color_bits; y < height; y++)
             for (x = 0; x < width; x++, ptr++)