From 232d48f0598561e1608d073aedfacd5ba3bae7fc Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 7 Dec 2012 11:22:42 -0500 Subject: Bug 395464 - Eclipse freezes when hovering over value in Variables view --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java index 60cb2cfc35..8bbaf163fa 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java @@ -53,6 +53,8 @@ public class Composite extends Scrollable { Control [] tabList; int layoutCount, backgroundMode; + static final int TOOLTIP_LIMIT = 4096; + /** * Prevents uninitialized instances from being created outside the package. */ @@ -1846,6 +1848,15 @@ LRESULT wmNotify (NMHDR hdr, int /*long*/ wParam, int /*long*/ lParam) { if (string != null) { Shell shell = getShell (); string = Display.withCrLf (string); + /* + * Bug in Windows. On Windows 7, tool tips hang when displaying large + * strings. The fix is to limit the tool tip string to 4Kb. + */ + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + if (string.length() > TOOLTIP_LIMIT) { + string = string.substring(0, TOOLTIP_LIMIT); + } + } char [] chars = fixMnemonic (string); /* -- cgit v1.2.3