1. When bitmaps are displayed in a window that is not the full size, there
   was a problem in the calculation of x and y.  The exact problem has to
   do with the /2, which is done on an unsigned long *before* it is converted
   to a int.  It should be converted to a signed int and *then* the division
   should occur.  Otherwise, the bitmap does not show up.  In normal X windows,
   if the x, y position of the dest is outside the window, it shift it back
   in.  The compatability library does not do this.  The problem will only
   show up if the current width of the window < bitmap width.  Same with the
   height.

   Changes were made to tkbutton.c, tkmenubutton.c, tkmessag.c, & tkscale.c.

   The sample below is from tkbutton.c

    if (butPtr->bitmap != None) {
	unsigned int width, height;

	Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
	switch (butPtr->anchor) {
	    case TK_ANCHOR_NW: case TK_ANCHOR_W: case TK_ANCHOR_SW:
		x = butPtr->borderWidth + butPtr->selectorSpace
			+ butPtr->padX + 1;
		break;
	    case TK_ANCHOR_N: case TK_ANCHOR_CENTER: case TK_ANCHOR_S:
		x = ((int) (Tk_Width(tkwin) + butPtr->selectorSpace - width))/2;
	  ^^^^^^^^^^^^^^^^fixed line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		break;
	    default:
		x = Tk_Width(tkwin) - butPtr->borderWidth - butPtr->padX
			- width - 1;
		break;
	}
	switch (butPtr->anchor) {
	    case TK_ANCHOR_NW: case TK_ANCHOR_N: case TK_ANCHOR_NE:
		y = butPtr->borderWidth + butPtr->padY + 1;
		break;
	    case TK_ANCHOR_W: case TK_ANCHOR_CENTER: case TK_ANCHOR_E:
		y = ((int) (Tk_Height(tkwin) - height))/2;
	  ^^^^^^^^^^^^^^^^fixed line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		break;
	    default:
		y = Tk_Height(tkwin) - butPtr->borderWidth - butPtr->padY
			- height - 1;
		break;
	}

2. The underlined changes.width should be changes.height
static void
ChangeEventWindow(eventPtr, winPtr)
    register XEvent *eventPtr;	/* Event to retarget.  Must have
				 * type ButtonPress, ButtonRelease, KeyPress,
				 * KeyRelease, MotionNotify, EnterNotify,
				 * or LeaveNotify. */
    TkWindow *winPtr;		/* New target window for event. */
{
    int x, y, sameScreen, bd;
    register TkWindow *childPtr;

    eventPtr->xmotion.window = Tk_WindowId(winPtr);
    if (eventPtr->xmotion.root ==
	    RootWindow(winPtr->display, winPtr->screenNum)) {
	Tk_GetRootCoords((Tk_Window) winPtr, &x, &y);
	eventPtr->xmotion.x = eventPtr->xmotion.x_root - x;
	eventPtr->xmotion.y = eventPtr->xmotion.y_root - y;
	eventPtr->xmotion.subwindow = None;
	for (childPtr = winPtr->childList; childPtr != NULL;
		childPtr = childPtr->nextPtr) {
	    if (childPtr->flags & TK_TOP_LEVEL) {
		continue;
	    }
	    x = eventPtr->xmotion.x - childPtr->changes.x;
	    y = eventPtr->xmotion.y - childPtr->changes.y;
	    bd = childPtr->changes.border_width;
	    if ((x >= -bd) && (y >= -bd)
		    && (x < (childPtr->changes.width + bd))
		    && (y < (childPtr->changes.width + bd))) {
					       ^^^^^
		eventPtr->xmotion.subwindow = childPtr->window;
	    }
	}
	sameScreen = 1;
    } else {
	eventPtr->xmotion.x = 0;
	eventPtr->xmotion.y = 0;
	eventPtr->xmotion.subwindow = None;
	sameScreen = 0;
    }
    if (eventPtr->type == MotionNotify) {
	eventPtr->xmotion.same_screen = sameScreen;
    } else {
	eventPtr->xbutton.same_screen = sameScreen;
    }
}

3. Not really a Tk problem, but in the widget demo, if you display the
   Canvas Floorplan demo, exit, and then try to bring it up again, it won't
   draw itself.
