changeset 8232:244f2ee51f31

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 287e0a7731ff
children f40f2421c60f
files src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Wed Oct 02 16:58:13 2013 +0400
+++ b/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();
     }