diff options
author | a_kovalenko <a_kovalenko> | 2010-06-22 14:02:31 (GMT) |
---|---|---|
committer | a_kovalenko <a_kovalenko> | 2010-06-22 14:02:31 (GMT) |
commit | eaa472eda7c92abd87df99c5208082825dbd146d (patch) | |
tree | d856dc2e8d1d9e3021184b4669eba49c4902cc91 | |
parent | af5c7cf0c34274560634e544d70228d63ed259d9 (diff) | |
download | tk-eaa472eda7c92abd87df99c5208082825dbd146d.zip tk-eaa472eda7c92abd87df99c5208082825dbd146d.tar.gz tk-eaa472eda7c92abd87df99c5208082825dbd146d.tar.bz2 |
[Patch #3019624] fix "place" command segfault on half-dead app main window.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tkPlace.c | 9 | ||||
-rw-r--r-- | generic/tkWindow.c | 4 |
3 files changed, 15 insertions, 6 deletions
@@ -1,3 +1,11 @@ +2010-06-22 Anton Kovalenko <a_kovalenko@users.sf.net> + + * generic/tkPlace.c: [Patch #3019624] modify "place" command, + making it get main window through ClientData (like grid or pack + do), instead of calling Tk_MainWindow(interp). + * generic/tkWindow.c: modify "place" entry in commands[], + turn on passMainWindow flag. + 2010-06-22 Jan Nijtmans <nijtmans@users.sf.net> * generic/ttk/ttkGenStubs.tcl [Bug #3019363] "make genstubs" failure diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 3586014..62ea86d 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlace.c,v 1.29 2010/01/02 22:52:38 dkf Exp $ + * RCS: @(#) $Id: tkPlace.c,v 1.30 2010/06/22 14:02:32 a_kovalenko Exp $ */ #include "tkInt.h" @@ -205,11 +205,12 @@ static void UnlinkSlave(Slave *slavePtr); int Tk_PlaceObjCmd( - ClientData clientData, /* NULL. */ + ClientData clientData, /* Interpreter main window. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { + Tk_Window main_win = clientData; Tk_Window tkwin; Slave *slavePtr; TkDisplay *dispPtr; @@ -237,7 +238,7 @@ Tk_PlaceObjCmd( */ if (Tcl_GetString(objv[1])[0] == '.') { - if (TkGetWindowFromObj(interp, Tk_MainWindow(interp), objv[1], + if (TkGetWindowFromObj(interp, main_win, objv[1], &tkwin) != TCL_OK) { return TCL_ERROR; } @@ -261,7 +262,7 @@ Tk_PlaceObjCmd( * possible additional arguments. */ - if (TkGetWindowFromObj(interp, Tk_MainWindow(interp), objv[2], + if (TkGetWindowFromObj(interp, main_win, objv[2], &tkwin) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tkWindow.c b/generic/tkWindow.c index e2f6f61..a47b080 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.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: tkWindow.c,v 1.112 2010/06/19 16:18:41 jenglish Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.113 2010/06/22 14:02:32 a_kovalenko Exp $ */ #include "tkInt.h" @@ -127,7 +127,7 @@ static const TkCmd commands[] = { {"lower", NULL, Tk_LowerObjCmd, NULL, 1, 1}, {"option", NULL, Tk_OptionObjCmd, NULL, 1, 1}, {"pack", NULL, Tk_PackObjCmd, NULL, 1, 1}, - {"place", NULL, Tk_PlaceObjCmd, NULL, 1, 0}, + {"place", NULL, Tk_PlaceObjCmd, NULL, 1, 1}, {"raise", NULL, Tk_RaiseObjCmd, NULL, 1, 1}, {"selection", NULL, Tk_SelectionObjCmd, NULL, 0, 1}, {"tk", NULL, NULL, TkInitTkCmd, 1, 1}, |