changeset 5298:dd81e08d4811

7192887: java/awt/Window/Grab/GrabTest.java still failed (fix failed for CR 7149068) Reviewed-by: art, serb
author denis
date Wed, 05 Sep 2012 20:04:54 +0400
parents dc172128c5d6
children 37377dcd43d0
files src/solaris/classes/sun/awt/X11/XWindowPeer.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Apr 20 13:13:00 2012 +0800
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Wed Sep 05 20:04:54 2012 +0400
@@ -1164,15 +1164,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();
@@ -1190,6 +1200,7 @@
             }
         }
     }
+
     boolean isResizable() {
         return winAttr.isResizable;
     }