From a4301a9954d4835a4b87344b9b037a816b17286d Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 16 Aug 2024 17:28:19 +0200 Subject: Only use the viewport height with forceValue set For cases where the available height is being computed and the CSS style has the height to auto, there available height is infinite. Don't return the viewport unless forceValue is set. --- dw/widget.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dw/widget.cc') diff --git a/dw/widget.cc b/dw/widget.cc index ce5286b9..d40eed97 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -723,7 +723,10 @@ int Widget::getAvailHeight (bool forceValue) height = applyPerHeight (layout->viewportHeight, getStyle()->height); } else { DBG_OBJ_MSG ("resize", 1, "no specification"); - height = layout->viewportHeight; + if (forceValue) + height = layout->viewportHeight; + else + height = -1; } DBG_OBJ_MSG_END (); -- cgit v1.2.3