From bf785b33260d445101b29e07fd7938c5f293c134 Mon Sep 17 00:00:00 2001 From: treectrl Date: Thu, 23 Nov 2006 00:42:26 +0000 Subject: Fix window elements not respecting -squeeze layout. --- generic/tkTreeElem.c | 19 +++++++++++++------ 1 file 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: -- cgit v0.12