private void maximize() { if (peer == null || isMaximized()) { return; } if (!undecorated) { CWrapper.NSWindow.zoom(getNSWindowPtr()); } else { deliverZoom(true); // We need an up to date size of the peer, so we flush the native events // to be sure that there are no setBounds requests in the queue. LWCToolkit.flushNativeSelectors(); this.normalBounds = peer.getBounds(); Rectangle maximizedBounds = peer.getMaximizedBounds(); setBounds( maximizedBounds.x, maximizedBounds.y, maximizedBounds.width, maximizedBounds.height); } }