changeset 9238:fa22e8668c4d

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 Mon, 24 Jul 2017 14:14:10 +0100
parents a2a339770678
children 851cd45750d2
files src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue May 23 11:30:25 2017 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Jul 24 14:14:10 2017 +0100
@@ -272,16 +272,21 @@
         contentView.execute(new CFNativeAction() {
             @Override
             public void run(final long viewPtr) {
+                boolean hasOwnerPtr = false;
+
                 if (owner != null) {
-                    owner.execute(new CFNativeAction() {
+                    hasOwnerPtr = 0L != owner.executeGet(new CFNativeActionGet() {
                         @Override
-                        public void run(long ownerPtr) {
+                        public long run(long 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));