summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-11-23 00:42:26 (GMT)
committertreectrl <treectrl>2006-11-23 00:42:26 (GMT)
commitbf785b33260d445101b29e07fd7938c5f293c134 (patch)
treee3284b9deb260ac6dd9a1139b1273b62dbb83df7 /generic
parent901c5bcb968c3d54ae256d818ac11f98b355e7da (diff)
downloadtktreectrl-bf785b33260d445101b29e07fd7938c5f293c134.zip
tktreectrl-bf785b33260d445101b29e07fd7938c5f293c134.tar.gz
tktreectrl-bf785b33260d445101b29e07fd7938c5f293c134.tar.bz2
Fix window elements not respecting -squeeze layout.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTreeElem.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/generic/tkTreeElem.c b/generic/tkTreeElem.c
index ff349cc..70a6dc8 100644
--- a/generic/tkTreeElem.c
+++ b/generic/tkTreeElem.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2002-2006 Tim Baker
*
- * RCS: @(#) $Id: tkTreeElem.c,v 1.50 2006/11/19 23:37:57 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeElem.c,v 1.51 2006/11/23 00:42:26 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -3746,20 +3746,27 @@ static void DisplayProcWindow(ElementArgs *args)
args->display.width, args->display.height,
TRUE, TRUE,
&x, &y, &width, &height);
+
x += tree->drawableXOrigin - tree->xOrigin;
y += tree->drawableYOrigin - tree->yOrigin;
- /*
- * If the window is completely out of the visible area of the treectrl
- * then unmap it. The window could suddenly reappear if the treectrl
- * window gets resized.
- */
+ /* -squeeze layout may give the element less space than requested. */
+ if (width > args->display.width)
+ width = args->display.width;
+ if (height > args->display.height)
+ height = args->display.height;
minX = args->display.bounds[0];
minY = args->display.bounds[1];
maxX = args->display.bounds[2];
maxY = args->display.bounds[3];
+ /*
+ * If the window is completely out of the visible area of the treectrl
+ * then unmap it. The window could suddenly reappear if the treectrl
+ * window gets resized.
+ */
+
if (((x + width) <= minX) || ((y + height) <= minY)
|| (x >= maxX) || (y >= maxY)) {
hideIt: