Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-12-14 22:13:51 +0000
committerMarkus Keller2016-12-14 22:13:51 +0000
commit13999a569890c90b79a7b2e6ea56ad6015fb86cb (patch)
tree6f528c008ac52955cb8853faa8e8331ed2e94956 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse
parent2a32fc9def3cbbb5db971f5873c47b5c79127318 (diff)
downloadeclipse.platform.swt-13999a569890c90b79a7b2e6ea56ad6015fb86cb.tar.gz
eclipse.platform.swt-13999a569890c90b79a7b2e6ea56ad6015fb86cb.tar.xz
eclipse.platform.swt-13999a569890c90b79a7b2e6ea56ad6015fb86cb.zip
Bug 491627: [win32] Rollover tooltip on TreeItem brings Shell to frontI20161214-2000
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java20
1 files changed, 13 insertions, 7 deletions
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 55c30e37c2..26bea48894 100644
--- 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
@@ -1928,15 +1928,21 @@ LRESULT wmNotify (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
if ((bits & OS.WS_EX_TOPMOST) != 0) break;
} while (true);
if (hwndParent != 0) break;
- display.lockActiveWindow = true;
- int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOSIZE;
/*
- * HWND_TOPMOST option places the window above all non-topmost
- * windows. The window maintains its topmost position even when
- * it is deactivated. Hence this option should be used only
- * on the active shell. See bug 491627 for more details.
+ * Bug in Windows. TTN_SHOW is sent for inactive shells. When
+ * SetWindowPos is called as a reaction, inactive shells can
+ * wrongly end up on top. The fix is to swallow such requests.
+ *
+ * A visible effect is that spurious tool tips can show up and
+ * disappear in a split second. This is a mostly harmless
+ * feature that can also be observed in the Windows Explorer.
+ * See bug 491627 for more details.
*/
- long /*int*/ hwndInsertAfter = (hdr.code == OS.TTN_SHOW && display.getActiveShell () == getShell ()) ? OS.HWND_TOPMOST : OS.HWND_NOTOPMOST;
+ if (display.getActiveShell () != getShell ()) return LRESULT.ONE;
+
+ display.lockActiveWindow = true;
+ int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOSIZE;
+ long /*int*/ hwndInsertAfter = hdr.code == OS.TTN_SHOW ? OS.HWND_TOPMOST : OS.HWND_NOTOPMOST;
SetWindowPos (hdr.hwndFrom, hwndInsertAfter, 0, 0, 0, 0, flags);
display.lockActiveWindow = false;
break;

Back to the top