From 8dd5c32785f13f36633b81a30186b977d740bf8b Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 31 Jul 2002 14:10:55 +0000 Subject: Postpone paned-window layout arrangement on geometry event until idle, as is done in other window managers, to fix problems with size calculations when the children don't already know their sizes anyway. Now the layout of the vertical pane demo works better (overall initial window width is right!) --- ChangeLog | 10 ++++++++++ generic/tkPanedWindow.c | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46113a7..b6084c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-07-31 Donal K. Fellows + + * generic/tkPanedWindow.c (PanedWindowReqProc): Postpone pane + arrangement until idle, as is done in other window managers, to + fix problems with size calculations when the children don't + already know their sizes anyway. + + * unix/configure: Regen. + * unix/tcl.m4: Update from Tcl. + 2002-07-29 Mo DeJong * unix/configure: Regen. diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index be14e9c..3e9cd4d 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.4 2002/06/19 23:17:17 hobbs Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.5 2002/07/31 14:10:56 dkf Exp $ */ #include "tkPort.h" @@ -1501,7 +1501,10 @@ PanedWindowReqProc(clientData, tkwin) { Slave *panePtr = (Slave *) clientData; PanedWindow *pwPtr = (PanedWindow *) (panePtr->masterPtr); - ComputeGeometry(pwPtr); + if (!(pwPtr->flags & REQUESTED_RELAYOUT)) { + pwPtr->flags |= REQUESTED_RELAYOUT; + Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr); + } } /* @@ -1810,7 +1813,7 @@ ComputeGeometry(pwPtr) int i, x, y, doubleBw, internalBw; int reqWidth, reqHeight, sashWidth, sxOff, syOff, hxOff, hyOff, dim; Slave *slavePtr; - + pwPtr->flags |= REQUESTED_RELAYOUT; x = y = internalBw = Tk_InternalBorderWidth(pwPtr->tkwin); -- cgit v0.12