A couple of small fixes to my bitmap patch.

diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c
index 128a32e..6c46061 100644
--- a/graphics/x11drv/bitmap.c
+++ b/graphics/x11drv/bitmap.c
@@ -28,11 +28,6 @@
 GC BITMAP_monoGC = 0, BITMAP_colorGC = 0;
 
 
-#define BITMAP_WIDTH_BYTES(width,bpp) \
-    (((bpp) == 24) ? (width) * 4 : ( ((bpp) == 15) ? (width) * 2 : \
-				    ((width) * (bpp) + 15) / 16 * 2 ))
-
-
 /***********************************************************************
  *           X11DRV_BITMAP_Init
  */
@@ -371,6 +366,8 @@
     XImage *image;
     LPBYTE sbuf, tmpbuffer;
     int	w, h, pad, widthbytes;
+
+    TRACE(x11drv, "(bmp=%p, bits=%p, count=%lx)\n", bmp, bits, count);
     
     pad = BITMAP_GetBitsPadding(bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel);
 
@@ -381,9 +378,12 @@
 
     widthbytes	= (((bmp->bitmap.bmWidth * bmp->bitmap.bmBitsPixel) + 31) /
 		   32) * 4;
-    height      = bmp->bitmap.bmHeight;
+    height      = count / bmp->bitmap.bmWidthBytes;
     tmpbuffer	= (LPBYTE)xmalloc(widthbytes*height);
 
+    TRACE(x11drv, "h=%ld, w=%d, wb=%d\n", height, bmp->bitmap.bmWidth, 
+	  widthbytes);
+
     EnterCriticalSection( &X11DRV_CritSection );
     image = XCreateImage( display, DefaultVisualOfScreen(screen),
                           bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
diff --git a/windows/graphics.c b/windows/graphics.c
index c949f46..b1fa1a1 100644
--- a/windows/graphics.c
+++ b/windows/graphics.c
@@ -80,6 +80,9 @@
         return FALSE;
     }
 
+    /* HACK for now */
+    if(!bmp->DDBitmap)
+        X11DRV_CreateBitmap( hbitmap );
     pbitmap = bmp->DDBitmap->physBitmap;
 
     xdest += dc->w.DCOrgX; ydest += dc->w.DCOrgY;
@@ -249,6 +252,10 @@
 	   GDI_HEAP_UNLOCK( hdc );
 	   return FALSE;
        }
+
+       /* HACK for now */
+       if(!bmp->DDBitmap)
+	   X11DRV_CreateBitmap( hMonoBitmap );
        pbitmap = bmp->DDBitmap->physBitmap;
        TSXSetClipOrigin( display, dc->u.x.gc, dc->w.DCOrgX + x, dc->w.DCOrgY + y);
     }