From 7b2e9d9bbdf2d8328e2f547b4c1df0c6b5ac3637 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 13 May 2021 18:16:14 +0000 Subject: [PATCH] lcl gtk3: undo visible check, issue #38886 git-svn-id: trunk@65112 - --- lcl/interfaces/gtk3/gtk3widgets.pas | 35 +++++++++++++---------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/lcl/interfaces/gtk3/gtk3widgets.pas b/lcl/interfaces/gtk3/gtk3widgets.pas index 57716a1c0f..51cd66276a 100644 --- a/lcl/interfaces/gtk3/gtk3widgets.pas +++ b/lcl/interfaces/gtk3/gtk3widgets.pas @@ -2932,12 +2932,10 @@ procedure TGtk3Widget.SetBounds(ALeft,ATop,AWidth,AHeight:integer); var ARect: TGdkRectangle; Alloc: TGtkAllocation; - AMinWidth, AMinHeight, ANaturalSize: gint; + AMinSize, ANaturalSize: gint; begin if (Widget=nil) then exit; - if (not Widget^.get_visible) and (not Widget^.is_toplevel) then - exit; if Self is TGtk3Button then begin @@ -2945,26 +2943,25 @@ begin dec(AHeight,4); end; + ARect.x := ALeft; + ARect.y := ATop; + ARect.width := AWidth; + ARect.Height := AHeight; + with Alloc do + begin + x := ALeft; + y := ATop; + width := AWidth; + height := AHeight; + end; BeginUpdate; try {fixes gtk3 assertion} - Widget^.get_preferred_width(@AMinWidth, @ANaturalSize); - Widget^.get_preferred_height(@AMinHeight, @ANaturalSize); - AWidth:=Max(AWidth,AMinWidth); - AHeight:=Max(AHeight,AMinHeight); - Widget^.set_size_request(AWidth,AHeight); + Widget^.get_preferred_width(@AMinSize, @ANaturalSize); + Widget^.get_preferred_height(@AMinSize, @ANaturalSize); - ARect.x := ALeft; - ARect.y := ATop; - ARect.width := AWidth; - ARect.Height := AHeight; - with Alloc do - begin - x := ALeft; - y := ATop; - width := AWidth; - height := AHeight; - end; + + Widget^.set_size_request(AWidth,AHeight); Widget^.size_allocate(@ARect); Widget^.set_allocation(@Alloc);