changeset 17184:4a610c6d0b9c

8178996: [macos] JComboBox doesn't display popup in mixed JavaFX Swing Application on 8u131 and Mac OS 10.12 Reviewed-by: serb, ssadetsky
author azvegint
date Fri, 12 May 2017 15:01:22 +0300
parents e4d6ad2be5df
children 828d3f3728a2
files src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri May 12 12:28:49 2017 +0530
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri May 12 15:01:22 2017 +0300
@@ -274,13 +274,18 @@
         }
         AtomicLong ref = new AtomicLong();
         contentView.execute(viewPtr -> {
+            boolean hasOwnerPtr = false;
+
             if (owner != null) {
-                owner.execute(ownerPtr -> {
+                hasOwnerPtr = 0L != owner.executeGet(ownerPtr -> {
                     ref.set(nativeCreateNSWindow(viewPtr, ownerPtr, styleBits,
-                                                 bounds.x, bounds.y,
-                                                 bounds.width, bounds.height));
+                                                    bounds.x, bounds.y,
+                                                    bounds.width, bounds.height));
+                    return 1;
                 });
-            } else {
+            }
+
+            if (!hasOwnerPtr) {
                 ref.set(nativeCreateNSWindow(viewPtr, 0,
                                              styleBits, bounds.x, bounds.y,
                                              bounds.width, bounds.height));