summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2008-11-05 16:39:19 +0000
committerSilenio Quarti <silenio>2008-11-05 16:39:19 +0000
commit6445693b451132fa7799211af4da0b7e0c65c57c (patch)
tree83001ca8e4d60aa03fcc9b1ddc928c70c6abeb11
parent05cc9ca4122ee9bf49be44d97da42c57cff458e3 (diff)
downloadeclipse.platform.swt-6445693b451132fa7799211af4da0b7e0c65c57c.tar.gz
eclipse.platform.swt-6445693b451132fa7799211af4da0b7e0c65c57c.tar.xz
eclipse.platform.swt-6445693b451132fa7799211af4da0b7e0c65c57c.zip
246057 - SWT_AWT application does not receive mouse events (back port to 3.4 stream)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java
index b707e60def..1382141a3a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/awt/SWT_AWT.java
@@ -278,6 +278,7 @@ public static Frame new_Frame (final Composite parent) {
}
});
break;
+ case SWT.FocusIn:
case SWT.Activate:
EventQueue.invokeLater(new Runnable () {
public void run () {
@@ -288,8 +289,8 @@ public static Frame new_Frame (final Composite parent) {
frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
frame.dispatchEvent (new WindowEvent (frame, 207 /*WindowEvent.WINDOW_GAINED_FOCUS*/));
} else {
+ if (frame.isActive()) return;
try {
- /* Initialize the default focus traversal policy */
Class clazz = frame.getClass();
Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class});
if (method != null) method.invoke(frame, new Object[]{new Boolean(true)});
@@ -308,8 +309,8 @@ public static Frame new_Frame (final Composite parent) {
frame.dispatchEvent (new WindowEvent (frame, 208 /*WindowEvent.WINDOW_LOST_FOCUS*/));
frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
} else {
+ if (!frame.isActive()) return;
try {
- /* Initialize the default focus traversal policy */
Class clazz = frame.getClass();
Method method = clazz.getMethod("synthesizeWindowActivation", new Class[]{boolean.class});
if (method != null) method.invoke(frame, new Object[]{new Boolean(false)});
@@ -321,7 +322,11 @@ public static Frame new_Frame (final Composite parent) {
}
}
};
- parent.addListener (SWT.Activate, listener);
+ if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 5, 0)) {
+ parent.addListener (SWT.Activate, listener);
+ } else {
+ parent.addListener (SWT.FocusIn, listener);
+ }
parent.addListener (SWT.Deactivate, listener);
parent.addListener (SWT.Dispose, listener);