]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/window_osx.cpp
never return negative client sizes, fixes #15338
[wxWidgets.git] / src / osx / window_osx.cpp
index e8ce2cfc67f36d79a2fd3d48b334f2648455596c..bba95e6e8a8b774daf545d098876a66228583ad5 100644 (file)
@@ -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)