changeset 56560:e448d58051ab

8211703: JInternalFrame : java.lang.AssertionError: cannot find the internal frame Reviewed-by: prr, serb
author psadhukhan
date Thu, 23 May 2019 10:50:47 +0530
parents eba6a83dc23b
children d85b366bd8f4
files src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Tue May 21 14:41:43 2019 +0530
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Thu May 23 10:50:47 2019 +0530
@@ -1471,7 +1471,14 @@
         JComponent comp = context.getComponent();
         JComponent titlePane = findChild(comp, "InternalFrame.northPane");
 
-        JInternalFrame jif = findInternalFrame(comp);
+        JInternalFrame jif;
+        if (comp instanceof JButton) {
+            JComponent bTitlePane = (JComponent)comp.getParent();
+            Container titlePaneParent = bTitlePane.getParent();
+            jif = findInternalFrame(titlePaneParent);
+        } else {
+            jif = findInternalFrame(comp);
+        }
         if (jif == null) {
             return;
         }
--- a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Tue May 21 14:41:43 2019 +0530
+++ b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Thu May 23 10:50:47 2019 +0530
@@ -64,6 +64,7 @@
 
 /*
  * @test
+ * @bug 8211703
  * @key headful
  * @summary Verifies SwingSet3 InternalFrameDemo page by checking the different
  *  actions on the parent frame, internal frame and creating internal frame