Print this page
*** NO COMMENTS ***

@@ -486,10 +486,17 @@
         if (!undecorated) {
             CWrapper.NSWindow.zoom(getNSWindowPtr());
         } else {
             deliverZoom(true);
 
+            // Bugfix for 8066436
+            // setSize has an aynchronous native call to osx which in turn calls
+            // deliverMoveResizeEvent which set the size of the peer
+            // if that call is still in process and the peer is size is not set,
+            // we may get bounds which are previous to setSize
+            // To avoid this we flush all the native events before getting bounds
+            LWCToolkit.flushNativeSelectors();
             this.normalBounds = peer.getBounds();
 
             GraphicsConfiguration config = getPeer().getGraphicsConfiguration();
             Insets i = ((CGraphicsDevice)config.getDevice()).getScreenInsets();
             Rectangle toBounds = config.getBounds();