Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2006-07-19 15:56:59 -0400
committerGrant Gayed2006-07-19 15:56:59 -0400
commitb8c5e7f3d6f00eec65d3dd2b0175ad65a75d4174 (patch)
treea0f4be21032036b8f52a6dd2f42a2e088355a329
parentd809bac22069f62455dacf378394ba4f4f450817 (diff)
downloadeclipse.platform.swt-R3_0_PMR00004_2DC_649.tar.gz
eclipse.platform.swt-R3_0_PMR00004_2DC_649.tar.xz
eclipse.platform.swt-R3_0_PMR00004_2DC_649.zip
56184 partial fix (closing of Acrobat in Browser)R3_0_PMR00004_2DC_649
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 18f836d4ae..5f6cf3ec40 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -289,7 +289,10 @@ public class Display extends Device {
static final int SWT_RESIZE = OS.WM_APP + 4;
static final int SWT_TRAYICONMSG = OS.WM_APP + 5;
static int SWT_TASKBARCREATED;
-
+
+ /* Workaround for Adobe Reader 7.0 */
+ int hitCount;
+
/* Package Name */
static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets."; //$NON-NLS-1$
/*
@@ -3331,6 +3334,27 @@ static int wcsToMbcs (char ch) {
}
int windowProc (int hwnd, int msg, int wParam, int lParam) {
+ /*
+ * Bug in Adobe Reader 7.0. For some reason, when Adobe
+ * Reader 7.0 is deactivated from within Internet Explorer,
+ * it sends thousands of consecutive WM_NCHITTEST messages
+ * to the control that is under the cursor. It seems that
+ * if the control takes some time to respond to the message,
+ * Adobe stops sending them. The fix is to detect this case
+ * and sleep.
+ *
+ * NOTE: Under normal circumstances, Windows will never send
+ * consecutive WM_NCHITTEST messages to the same control without
+ * another message (normally WM_SETCURSOR) in between.
+ */
+ if (msg == OS.WM_NCHITTEST) {
+ if (hitCount++ >= 1024) {
+ try {Thread.sleep (1);} catch (Throwable t) {}
+ }
+ } else {
+ hitCount = 0;
+ }
+
int index = OS.GetWindowLong (hwnd, OS.GWL_USERDATA) - 1;
if (0 <= index && index < controlTable.length) {
Control control = controlTable [index];

Back to the top