changeset 11933:c66f5a825a0f jdk8u112-b07

Merge
author asaha
date Mon, 01 Aug 2016 12:37:44 -0700
parents d76b11a30333 5d5944dbe18b
children e4082b9b37c9
files .hgtags
diffstat 3 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jul 27 11:10:10 2016 -0700
+++ b/.hgtags	Mon Aug 01 12:37:44 2016 -0700
@@ -635,6 +635,7 @@
 710f0c95444deb36b422f449f422d925a72f6b2c jdk8u111-b04
 d689f7b806c89e535f784ba94bea1ae129ee0f19 jdk8u111-b05
 6c822cce832523a5aee9632e28065f0c302187ed jdk8u111-b06
+1afe84012d643b4092dbf25f1cbb761508c19ed2 jdk8u111-b07
 47e20a90bdbb2327289e330606b73a9fe4dc857e jdk8u112-b00
 96393e490afd4acba5b92c5ede68dc9bbb60a38e jdk8u112-b01
 b44d695f738baba091370828b84ae2c4cd715c1b jdk8u112-b02
--- a/src/windows/classes/sun/awt/windows/WFramePeer.java	Wed Jul 27 11:10:10 2016 -0700
+++ b/src/windows/classes/sun/awt/windows/WFramePeer.java	Mon Aug 01 12:37:44 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,6 +153,19 @@
     @Override
     public void setMenuBar(MenuBar mb) {
         WMenuBarPeer mbPeer = (WMenuBarPeer) WToolkit.targetToPeer(mb);
+        if (mbPeer != null) {
+            if (mbPeer.framePeer != this) {
+                mb.removeNotify();
+                mb.addNotify();
+                mbPeer = (WMenuBarPeer) WToolkit.targetToPeer(mb);
+                if (mbPeer != null && mbPeer.framePeer != this) {
+                    throw new IllegalStateException("Wrong parent peer");
+                }
+            }
+            if (mbPeer != null) {
+                addChildPeer(mbPeer);
+            }
+        }
         setMenuBar0(mbPeer);
         updateInsets(insets_);
     }
--- a/src/windows/classes/sun/awt/windows/WMenuBarPeer.java	Wed Jul 27 11:10:10 2016 -0700
+++ b/src/windows/classes/sun/awt/windows/WMenuBarPeer.java	Mon Aug 01 12:37:44 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 
     // MenuBarPeer implementation
 
+    final WFramePeer framePeer;
+
     @Override
     public native void addMenu(Menu m);
     @Override
@@ -44,8 +46,11 @@
     // Toolkit & peer internals
     WMenuBarPeer(MenuBar target) {
         this.target = target;
-        WFramePeer framePeer = (WFramePeer)
+        framePeer = (WFramePeer)
             WToolkit.targetToPeer(target.getParent());
+        if (framePeer != null) {
+            framePeer.addChildPeer(this);
+        }
         create(framePeer);
         // fix for 5088782: check if menu object is created successfully
         checkMenuCreation();