From b592c92417310d09316da0ff2f19f22185d8d401 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Mon, 28 Dec 2009 20:35:41 +0300 Subject: [PATCH] 6857363: deadlock caused by sun.awt.X11.XTrayIconPeer$Tooltip.display Reviewed-by: ant, art --- .../classes/sun/awt/X11/InfoWindow.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java index c5deb685813..bc51b69b296 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java @@ -189,21 +189,22 @@ public abstract class InfoWindow extends Window { * 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())) {