From 13e70fa49b33490f764d8115cfe58eeda303a2c8 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 13 May 2004 14:29:22 +0000 Subject: * generic/tkBind.c : Modified to fix wish crach due to incorrectly generate event. This bug was reported in comp.lang.tcl but not logged. --- ChangeLog | 5 +++++ generic/tkBind.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a0cad4..3188910 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-05-12 Chengye Mao + * generic/tkBind.c : Modified to fix wish + crach due to incorrectly generate event. This bug was + reported in comp.lang.tcl but not logged. + 2004-05-10 Pat Thoyts * win/makefile.vc: Apply fix from tcl bug #950049 for make docs. diff --git a/generic/tkBind.c b/generic/tkBind.c index 13e6cea..978f8ee 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.28.2.1 2004/02/18 02:17:18 hobbs Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.28.2.2 2004/05/13 14:29:22 dgp Exp $ */ #include "tkPort.h" @@ -3392,6 +3392,14 @@ HandleEventGenerate(interp, mainWin, objc, objv) event.xany.display = Tk_Display(tkwin); flags = flagArray[event.xany.type]; + if (flags & DESTROY) { + /* + * Event DesotryNotify should be generated by destroying + * the window. + */ + Tk_DestroyWindow(tkwin); + return TCL_OK; + } if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) { event.xkey.state = pat.needMods; if ((flags & KEY) && (event.xany.type != MouseWheelEvent)) { @@ -3402,7 +3410,7 @@ HandleEventGenerate(interp, mainWin, objc, objv) ((XVirtualEvent *) &event)->name = pat.detail.name; } } - if (flags & (CREATE|DESTROY|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) { + if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) { event.xcreatewindow.window = event.xany.window; } @@ -3767,7 +3775,7 @@ HandleEventGenerate(interp, mainWin, objc, objv) if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) { return TCL_ERROR; } - if (flags & (CREATE|DESTROY|UNMAP|MAP|REPARENT|CONFIG + if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG |GRAVITY|CIRC)) { event.xcreatewindow.window = Tk_WindowId(tkwin2); } else { -- cgit v0.12