diff --git a/lcl/interfaces/cocoa/cocoaprivate.pp b/lcl/interfaces/cocoa/cocoaprivate.pp index c4dc3d0cbd..ea5158f433 100644 --- a/lcl/interfaces/cocoa/cocoaprivate.pp +++ b/lcl/interfaces/cocoa/cocoaprivate.pp @@ -1731,12 +1731,22 @@ end; procedure LCLWindowExtension.lclSetFrame(const r: TRect); var - ns: NSREct; + ns: NSRect; + nw,nf: NSRect; + h:integer; begin if Assigned(screen) then LCLToNSRect(r, screen.frame.size.height, ns) else ns := RectToNSRect(r); + + // get topbar height and add + nf:= NSMakeRect (0, 0, 100, 100); + nw:=contentRectForFrameRect(nf); + h:=round(nf.size.height-nw.size.height); + ns.size.height:=ns.size.height+h; + ns.origin.y:=ns.origin.y-h; + setFrame_display(ns, isVisible); end; diff --git a/lcl/interfaces/cocoa/cocoautils.pas b/lcl/interfaces/cocoa/cocoautils.pas index 72f22e685a..57fb658e02 100644 --- a/lcl/interfaces/cocoa/cocoautils.pas +++ b/lcl/interfaces/cocoa/cocoautils.pas @@ -293,7 +293,7 @@ end; procedure LCLToNSRect(const lcl: TRect; ParentHeight: Single; out ns: NSRect); begin ns.origin.x:=lcl.left; - ns.origin.y:=ParentHeight-(lcl.bottom-lcl.Top)-lcl.Top; + ns.origin.y:=ParentHeight-lcl.bottom; ns.size.width:=lcl.Right-lcl.Left; ns.size.height:=lcl.Bottom-lcl.Top; end;