From 4b50534529bae9e255878968cb45df8974e867dd Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 30 Aug 2008 19:26:18 +0000 Subject: [PATCH] gtk intf: added safety check git-svn-id: trunk@16310 - --- lcl/interfaces/gtk/gtkwinapi.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index e50d4b4f81..75e1412463 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -6400,7 +6400,8 @@ begin begin Widget := PGtkWidget(Handle); ARect.TopLeft := GetWidgetOrigin(Widget); - ARect.BottomRight := Point(ARect.Left + Widget^.allocation.width, ARect.Top + Widget^.allocation.height); + ARect.BottomRight := Point(ARect.Left + Widget^.allocation.width, + ARect.Top + Widget^.allocation.height); end; end; @@ -6437,8 +6438,8 @@ function TGtkWidgetSet.GetWindowSize(Handle : hwnd; begin if GtkWidgetIsA(PGtkWidget(Handle),GTK_TYPE_WIDGET) then begin Result:=true; - Width:=PGtkWidget(Handle)^.Allocation.Width; - Height:=PGtkWidget(Handle)^.Allocation.Height; + Width:=Max(0,PGtkWidget(Handle)^.Allocation.Width); + Height:=Max(0,PGtkWidget(Handle)^.Allocation.Height); end else Result:=false; end;