# HG changeset patch # User dcherepanov # Date 1262021741 -10800 # Node ID 34aa9ad0f200030729e685a1f34cfdfeba87e0de # Parent 21778cfb435361b46215f89e8543d991cbd2ec6b 6857363: deadlock caused by sun.awt.X11.XTrayIconPeer$Tooltip.display Reviewed-by: ant, art diff -r 21778cfb4353 -r 34aa9ad0f200 jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java --- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java Tue Dec 22 17:28:52 2009 +0300 +++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java Mon Dec 28 20:35:41 2009 +0300 @@ -189,21 +189,22 @@ * WARNING: this method is executed on Toolkit thread! */ private void display() { - String tooltipString = liveArguments.getTooltipString(); - if (tooltipString == null) { - return; - } else if (tooltipString.length() > TOOLTIP_MAX_LENGTH) { - textLabel.setText(tooltipString.substring(0, TOOLTIP_MAX_LENGTH)); - } else { - textLabel.setText(tooltipString); - } - // Execute on EDT to avoid deadlock (see 6280857). SunToolkit.executeOnEventHandlerThread(target, new Runnable() { public void run() { if (liveArguments.isDisposed()) { return; } + + String tooltipString = liveArguments.getTooltipString(); + if (tooltipString == null) { + return; + } else if (tooltipString.length() > TOOLTIP_MAX_LENGTH) { + textLabel.setText(tooltipString.substring(0, TOOLTIP_MAX_LENGTH)); + } else { + textLabel.setText(tooltipString); + } + Point pointer = (Point)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { if (!isPointerOverTrayIcon(liveArguments.getBounds())) {