changeset 11998:bf791a3c022c

Merge
author asaha
date Tue, 30 Aug 2016 10:11:23 -0700
parents 8434be67b940 0fd120d95c5b
children e16018c90ebc 1cf5785cdd47
files .hgtags src/macosx/native/sun/awt/AWTView.m
diffstat 2 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 29 11:19:34 2016 -0700
+++ b/.hgtags	Tue Aug 30 10:11:23 2016 -0700
@@ -628,6 +628,8 @@
 901ecf04370c7c03c61e22ab87a266c355baff54 jdk8u102-b13
 48c99b42383912886c005891c04b5f599adf6722 jdk8u102-b14
 222d3ac3aa1f99f16e31c1c4a10f916ce83ff759 jdk8u102-b31
+e3839fe291add6e0ea199457fb31c9312cc5dd77 jdk8u102-b32
+275fcb7d4e3e70a37ac70c33d087a805ba182f1e jdk8u102-b33
 ebc56c2e803597ef409a5296addc986b390d934d jdk8u111-b00
 c4f03717831993e4658b8366810ca4682ece952d jdk8u111-b01
 de1d09f09e571e38afdf1fb72984ec210e7c19e6 jdk8u111-b02
--- a/src/macosx/native/sun/awt/AWTWindow.m	Mon Aug 29 11:19:34 2016 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Tue Aug 30 10:11:23 2016 -0700
@@ -800,6 +800,18 @@
 
 - (void)sendEvent:(NSEvent *)event {
         if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) {
+            // Move parent windows to front and make sure that a child window is displayed
+            // in front of its nearest parent.
+            if (self.ownerWindow != nil) {
+                JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
+                jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
+                if (platformWindow != NULL) {
+                    static JNF_MEMBER_CACHE(jm_orderAboveSiblings, jc_CPlatformWindow, "orderAboveSiblings", "()V");
+                    JNFCallVoidMethod(env,platformWindow, jm_orderAboveSiblings);
+                    (*env)->DeleteLocalRef(env, platformWindow);
+                }
+            }
+            [self orderChildWindows:YES];
 
             NSPoint p = [NSEvent mouseLocation];
             NSRect frame = [self.nsWindow frame];
@@ -1100,6 +1112,16 @@
     NSWindow *nsWindow = OBJC(windowPtr);
     [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
         [nsWindow orderBack:nil];
+        // Order parent windows
+        AWTWindow *awtWindow = (AWTWindow*)[nsWindow delegate];
+        while (awtWindow.ownerWindow != nil) {
+            awtWindow = awtWindow.ownerWindow;
+            if ([AWTWindow isJavaPlatformWindowVisible:awtWindow.nsWindow]) {
+                [awtWindow.nsWindow orderBack:nil];
+            }
+        }
+        // Order child windows
+        [(AWTWindow*)[nsWindow delegate] orderChildWindows:NO];
     }];
 
 JNF_COCOA_EXIT(env);