7192887: java/awt/Window/Grab/GrabTest.java still failed (fix failed for CR 7149068)
authordenis
Thu, 30 Aug 2012 01:17:24 +0400
changeset 13649 ac4f162d1f35
parent 13648 90effcfc064f
child 13650 0cf56ea6f0c6
7192887: java/awt/Window/Grab/GrabTest.java still failed (fix failed for CR 7149068) Reviewed-by: ant, serb
jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Wed Aug 29 19:53:35 2012 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Thu Aug 30 01:17:24 2012 +0400
@@ -1165,15 +1165,25 @@
     }
 
     public void dispose() {
+        if (isGrabbed()) {
+            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
+            }
+            postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
+        }
+
         SunToolkit.awtLock();
+
         try {
             windows.remove(this);
         } finally {
             SunToolkit.awtUnlock();
         }
+
         if (warningWindow != null) {
             warningWindow.destroy();
         }
+
         removeRootPropertyEventDispatcher();
         mustControlStackPosition = false;
         super.dispose();
@@ -1191,6 +1201,7 @@
             }
         }
     }
+
     boolean isResizable() {
         return winAttr.isResizable;
     }