From d58e3e3ce6081b76a358fb2d3a07391e970d1539 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 20 Jul 2020 17:57:33 +0200 Subject: [PATCH] Fix returning wrong client size for some controls in wxOSX Make sure we are not neglecting the layout insets, for controls like button, choice and gauge, otherwise client sizes became larger than control sizes. Closes #18717. --- src/osx/cocoa/window.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 2fd1559bae..62fb443d5e 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3083,6 +3083,13 @@ void wxWidgetCocoaImpl::GetContentArea( int&left, int &top, int &width, int &hei { left = top = 0; GetSize( width, height ); + + int leftinset, topinset, rightinset, bottominset; + GetLayoutInset( leftinset, topinset, rightinset, bottominset); + left += leftinset; + top += topinset; + width -= leftinset + rightinset; + height -= topinset + bottominset; } }