summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java16
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java16
2 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 34db20b4e7..18a86b7407 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -134,6 +134,22 @@ public void addSelectionListener (SelectionListener listener) {
int callWindowProc (int hwnd, int msg, int wParam, int lParam) {
if (handle == 0) return 0;
+ /*
+ * Bug in Windows. For some reason, when the user clicks
+ * on this control, the Windows hook WH_MSGFILTER is sent
+ * despite the fact that an input event from a dialog box,
+ * message box, menu, or scroll bar did not seem to occur.
+ * The fix is to ignore the hook.
+ */
+ switch (msg) {
+ case OS.WM_LBUTTONDOWN:
+ case OS.WM_MBUTTONDOWN:
+ case OS.WM_RBUTTONDOWN:
+ display.ignoreMsgFilter = true;
+ int code = OS.CallWindowProc (TableProc, hwnd, msg, wParam, lParam);
+ display.ignoreMsgFilter = false;
+ return code;
+ }
return OS.CallWindowProc (TableProc, hwnd, msg, wParam, lParam);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 17b10d95df..b8f4c452d1 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -168,6 +168,22 @@ public void addTreeListener(TreeListener listener) {
int callWindowProc (int hwnd, int msg, int wParam, int lParam) {
if (handle == 0) return 0;
+ /*
+ * Bug in Windows. For some reason, when the user clicks
+ * on this control, the Windows hook WH_MSGFILTER is sent
+ * despite the fact that an input event from a dialog box,
+ * message box, menu, or scroll bar did not seem to occur.
+ * The fix is to ignore the hook.
+ */
+ switch (msg) {
+ case OS.WM_LBUTTONDOWN:
+ case OS.WM_MBUTTONDOWN:
+ case OS.WM_RBUTTONDOWN:
+ display.ignoreMsgFilter = true;
+ int code = OS.CallWindowProc (TreeProc, hwnd, msg, wParam, lParam);
+ display.ignoreMsgFilter = false;
+ return code;
+ }
return OS.CallWindowProc (TreeProc, hwnd, msg, wParam, lParam);
}