diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvWind.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 7b8c844..c04db84 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvWind.c,v 1.9.2.1 2004/11/17 22:44:37 hobbs Exp $ + * RCS: @(#) $Id: tkCanvWind.c,v 1.9.2.2 2006/05/12 18:17:55 das Exp $ */ #include <stdio.h> @@ -599,7 +599,12 @@ DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY, if (state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } - if (state == TK_STATE_HIDDEN) { + + /* + * A drawable of None is used by the canvas UnmapNotify handler + * to indicate that we should no longer display ourselves. + */ + if (state == TK_STATE_HIDDEN || drawable == None) { if (canvasTkwin == Tk_Parent(winItemPtr->tkwin)) { Tk_UnmapWindow(winItemPtr->tkwin); } else { @@ -1062,8 +1067,14 @@ WinItemRequestProc(clientData, tkwin) WindowItem *winItemPtr = (WindowItem *) clientData; ComputeWindowBbox(winItemPtr->canvas, winItemPtr); - DisplayWinItem(winItemPtr->canvas, (Tk_Item *) winItemPtr, - (Display *) NULL, (Drawable) None, 0, 0, 0, 0); + + /* + * A drawable argument of None to DisplayWinItem is used by the canvas + * UnmapNotify handler to indicate that we should no longer display + * ourselves, so need to pass a (bogus) non-zero drawable value here. + */ + DisplayWinItem(winItemPtr->canvas, (Tk_Item *) winItemPtr, NULL, + (Drawable) -1, 0, 0, 0, 0); } /* |