changeset 20449:20326f6cd2aa

8023994: Right click on the icon added to the system tray for the first time, java.lang.IllegalArgumentException thrown. Reviewed-by: anthony, serb
author leonidr
date Wed, 02 Oct 2013 17:06:09 +0400
parents 0eef03207781
children 008da09ac2b2
files jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Wed Oct 02 16:58:13 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Wed Oct 02 17:06:09 2013 +0400
@@ -116,6 +116,8 @@
     protected Point grabInputPoint = null;
     protected boolean hasPointerMoved = false;
 
+    private AppContext disposeAppContext;
+
     /************************************************
      *
      * Mapping data
@@ -174,6 +176,8 @@
     XBaseMenuWindow() {
         super(new XCreateWindowParams(new Object[] {
             DELAYED, Boolean.TRUE}));
+
+        disposeAppContext = AppContext.getAppContext();
     }
 
     /************************************************
@@ -904,12 +908,12 @@
      */
     public void dispose() {
         setDisposed(true);
-        InvocationEvent ev = new InvocationEvent(target, new Runnable() {
+
+        SunToolkit.invokeLaterOnAppContext(disposeAppContext, new Runnable()  {
             public void run() {
                 doDispose();
             }
         });
-        super.postEvent(ev);
     }
 
     /**
@@ -923,7 +927,6 @@
         if (oldData != null) {
             oldData.invalidate();
         }
-        XToolkit.targetDisposedPeer(target, this);
         destroy();
     }