From c93a9c50a513155e0606c990978d63b6e5ca1f5f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 16 Jul 2013 05:13:35 +0000 Subject: [PATCH] never return negative client sizes, fixes #15338 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/window_osx.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index e8ce2cfc67..bba95e6e8a 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -872,9 +872,22 @@ void wxWindowMac::DoGetClientSize( int *x, int *y ) const #endif if (x) - *x = ww; + { + // we shouldn't return invalid width + if ( ww < 0 ) + ww = 0; + + *x = ww; + } + if (y) - *y = hh; + { + // we shouldn't return invalid height + if ( hh < 0 ) + hh = 0; + + *y = hh; + } } bool wxWindowMac::SetCursor(const wxCursor& cursor) -- 2.47.2