8023994: Right click on the icon added to the system tray for the first time, java.lang.IllegalArgumentException thrown.
Reviewed-by: anthony, serb
--- 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();
}