Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2006-08-02 13:49:09 +0000
committerSteve Northover2006-08-02 13:49:09 +0000
commit7c28c08cca103064f6b9c2497fa2dd55a3193e62 (patch)
tree1e8ce97ed174849003c703b0758a579f4eee8985 /bundles
parente05e6f1607761cf74612128ec782d3e355b7bb8b (diff)
downloadeclipse.platform.swt-7c28c08cca103064f6b9c2497fa2dd55a3193e62.tar.gz
eclipse.platform.swt-7c28c08cca103064f6b9c2497fa2dd55a3193e62.tar.xz
eclipse.platform.swt-7c28c08cca103064f6b9c2497fa2dd55a3193e62.zip
152385 - Tooltip is not shown all the time
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java12
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java12
2 files changed, 24 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index bc78d0b50e..9e924e2001 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -3740,6 +3740,18 @@ LRESULT WM_MOUSEHOVER (int wParam, int lParam) {
}
LRESULT WM_MOUSELEAVE (int wParam, int lParam) {
+ /*
+ * Bug in Windows. On XP, when a tooltip that
+ * uses TTF_IDISHWND is hidden due to a time out
+ * or mouse press, the tooltip remains active
+ * although no longer visible and won't show
+ * again until another tooltip becomes active.
+ * If there is only one tooltip in the window,
+ * it will never show again. The fix is to
+ * remove the current tooltip and add it again
+ * every time the mouse leaves the control.
+ */
+ if (OS.COMCTL32_MAJOR >= 6) getShell ().fixToolTip ();
return wmMouseLeave (handle, wParam, lParam);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index 7e9b9493f8..9875a9326b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -712,6 +712,18 @@ void fixShell (Shell newShell, Control control) {
}
}
+void fixToolTip () {
+ if (toolTipHandle == 0) return;
+ TOOLINFO lpti = new TOOLINFO ();
+ lpti.cbSize = TOOLINFO.sizeof;
+ if (OS.SendMessage (toolTipHandle, OS.TTM_GETCURRENTTOOL, 0, lpti) != 0) {
+ if ((lpti.uFlags & OS.TTF_IDISHWND) != 0) {
+ OS.SendMessage (toolTipHandle, OS.TTM_DELTOOL, 0, lpti);
+ OS.SendMessage (toolTipHandle, OS.TTM_ADDTOOL, 0, lpti);
+ }
+ }
+}
+
/**
* If the receiver is visible, moves it to the top of the
* drawing order for the display on which it was created

Back to the top