src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
changeset 59189 b5cdba232fca
parent 54861 769dbf384c44
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Thu Nov 14 10:59:45 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Thu Nov 14 15:13:29 2019 -0800
@@ -1237,6 +1237,15 @@
         // ensure we repaint the whole window after the resize operation
         // (this will also re-enable screen updates, which were disabled above)
         // TODO: send PaintEvent
+
+        // the macOS may ignore our "setFrame" request, in this, case the
+        // windowDidMove() will not come and we need to manually resync the
+        // "java.awt.Window" and NSWindow locations, because "java.awt.Window"
+        // already uses location ignored by the macOS.
+        // see sun.lwawt.LWWindowPeer#notifyReshape()
+        if (!NSEqualRects(rect, [nsWindow frame])) {
+            [window _deliverMoveResizeEvent];
+        }
     }];
 
 JNF_COCOA_EXIT(env);