diff options
author | pspjuth <peter.spjuth@gmail.com> | 2009-09-18 22:35:00 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2009-09-18 22:35:00 (GMT) |
commit | edff204f863b5527369a1ca046d40240fe45754d (patch) | |
tree | 9ddd43380dafb315f6433dbdd5f411d9fa1d7f79 | |
parent | 33e2ffcd22e3a6489550d76769c30cdaf2855466 (diff) | |
download | tk-edff204f863b5527369a1ca046d40240fe45754d.zip tk-edff204f863b5527369a1ca046d40240fe45754d.tar.gz tk-edff204f863b5527369a1ca046d40240fe45754d.tar.bz2 |
Bug fix in grid/pack collision detect.
Faulty slave was not properly blocked from slave list. [Bug 2859912]
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tkGrid.c | 3 | ||||
-rw-r--r-- | generic/tkPack.c | 4 | ||||
-rw-r--r-- | tests/packgrid.test | 32 |
4 files changed, 43 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2009-09-19 Peter Spjuth <peter.spjuth@gmail.com> + + * generic/tkGrid.c + * generic/tkPack.c + * tests/packgrid.test: Bug fix in grid/pack collision detect. + Faulty slave was not properly blocked from slave list. [Bug 2859912] + 2009-09-14 Jeff Hobbs <jeffh@ActiveState.com> * generic/tkMenuDraw.c (TkPostSubmenu): Fix reposting of submenu in diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 6dbe9a3..2ea78c0 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrid.c,v 1.53 2009/08/19 23:02:00 pspjuth Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.54 2009/09/18 22:35:00 pspjuth Exp $ */ #include "tkInt.h" @@ -3293,6 +3293,7 @@ ConfigureSlaves( if (TkSetGeometryMaster(interp, masterPtr->tkwin, "grid") != TCL_OK) { Tk_ManageGeometry(slave, NULL, NULL); + Unlink(slavePtr); return TCL_ERROR; } masterPtr->flags |= ALLOCED_MASTER; diff --git a/generic/tkPack.c b/generic/tkPack.c index c113e6f..d57d2bf 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.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: tkPack.c,v 1.34 2009/08/19 23:02:00 pspjuth Exp $ + * RCS: @(#) $Id: tkPack.c,v 1.35 2009/09/18 22:35:00 pspjuth Exp $ */ #include "tkInt.h" @@ -1261,6 +1261,7 @@ PackAfter( if (TkSetGeometryMaster(interp, masterPtr->tkwin, "pack") != TCL_OK) { Tk_ManageGeometry(tkwin, NULL, NULL); + Unlink(packPtr); return TCL_ERROR; } masterPtr->flags |= ALLOCED_MASTER; @@ -1793,6 +1794,7 @@ ConfigureSlaves( if (TkSetGeometryMaster(interp, masterPtr->tkwin, "pack") != TCL_OK) { Tk_ManageGeometry(slave, NULL, NULL); + Unlink(slavePtr); return TCL_ERROR; } masterPtr->flags |= ALLOCED_MASTER; diff --git a/tests/packgrid.test b/tests/packgrid.test index cbbb6f0..66d4e4c 100644 --- a/tests/packgrid.test +++ b/tests/packgrid.test @@ -5,7 +5,7 @@ # Copyright (c) 2008 Peter Spjuth # All rights reserved. # -# RCS: @(#) $Id: packgrid.test,v 1.1 2009/08/19 23:02:00 pspjuth Exp $ +# RCS: @(#) $Id: packgrid.test,v 1.2 2009/09/18 22:35:00 pspjuth Exp $ # package require tcltest 2.2 @@ -97,6 +97,36 @@ test packgrid-1.6 {pack and grid in same master} -setup { destroy .g } -result {} +test packgrid-1.7 {pack and grid in same master} -setup { + grid propagate . true + pack propagate . true + label .p -text PACK + label .g -text GRID +} -body { + # Basic conflict should stop widget from being handled + grid .g + catch { pack .p } + pack slaves . +} -cleanup { + destroy .p + destroy .g +} -result {} + +test packgrid-1.8 {pack and grid in same master} -setup { + grid propagate . true + pack propagate . true + label .p -text PACK + label .g -text GRID +} -body { + # Basic conflict should stop widget from being handled + pack .p + catch { grid .g } + grid slaves . +} -cleanup { + destroy .p + destroy .g +} -result {} + test packgrid-2.1 {pack and grid in same master, change propagation} -setup { grid propagate . false pack propagate . true |