summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2010-02-18 14:59:54 +0000
committerGrant Gayed <ggayed>2010-02-18 14:59:54 +0000
commit9e4aa4f79d8d08d57d797296be9d3269723e755b (patch)
tree7c792f0dfdcfb7012a267af47c88c1684d740e7d
parent45d1394589cdfd3c722aaffee70bb2c66e375216 (diff)
downloadeclipse.platform.swt-9e4aa4f79d8d08d57d797296be9d3269723e755b.tar.gz
eclipse.platform.swt-9e4aa4f79d8d08d57d797296be9d3269723e755b.tar.xz
eclipse.platform.swt-9e4aa4f79d8d08d57d797296be9d3269723e755b.zip
260533 - menuAboutToShow is inadvertently(?) called when using a shortcut while a Browser has focus
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java3
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java11
2 files changed, 13 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
index 9e4a5f43ba..6b9c55e665 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
@@ -65,6 +65,7 @@ final public class OleFrame extends Composite
private static final short [] ACCENTS = new short [] {'~', '`', '\'', '^', '"'};
private static final String CONSUME_KEY = "org.eclipse.swt.OleFrame.ConsumeKey"; //$NON-NLS-1$
+ private static final String ACCEL_KEY_HIT = "org.eclipse.swt.internal.win32.accelKeyHit"; //$NON-NLS-1$
/**
* Create an OleFrame child widget using style bits
@@ -217,7 +218,9 @@ static int /*long*/ getMsgProc(int /*long*/ code, int /*long*/ wParam, int /*lon
if (!rc || (lpgui.flags & mask) == 0) {
OleFrame frame = site.frame;
frame.setData(CONSUME_KEY, null);
+ display.setData(ACCEL_KEY_HIT, Boolean.TRUE);
consumed = frame.translateOleAccelerator(msg);
+ display.setData(ACCEL_KEY_HIT, Boolean.FALSE);
String value = (String)frame.getData(CONSUME_KEY);
if (value != null) consumed = value.equals("true"); //$NON-NLS-1$
frame.setData(CONSUME_KEY, null);
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 9ddb649948..6c83827301 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
@@ -202,6 +202,7 @@ public class Display extends Device {
static final String RUN_MESSAGES_IN_IDLE_KEY = "org.eclipse.swt.internal.win32.runMessagesInIdle"; //$NON-NLS-1$
static final String RUN_MESSAGES_IN_MESSAGE_PROC_KEY = "org.eclipse.swt.internal.win32.runMessagesInMessageProc"; //$NON-NLS-1$
static final String USE_OWNDC_KEY = "org.eclipse.swt.internal.win32.useOwnDC"; //$NON-NLS-1$
+ static final String ACCEL_KEY_HIT = "org.eclipse.swt.internal.win32.accelKeyHit"; //$NON-NLS-1$
Thread thread;
/* Display Shutdown */
@@ -1667,6 +1668,9 @@ public Object getData (String key) {
if (key.equals (USE_OWNDC_KEY)) {
return new Boolean (useOwnDC);
}
+ if (key.equals (ACCEL_KEY_HIT)) {
+ return new Boolean (accelKeyHit);
+ }
if (keys == null) return null;
for (int i=0; i<keys.length; i++) {
if (keys [i].equals (key)) return values [i];
@@ -4269,7 +4273,12 @@ public void setData (String key, Object value) {
Boolean data = (Boolean) value;
useOwnDC = data != null && data.booleanValue ();
return;
- }
+ }
+ if (key.equals (ACCEL_KEY_HIT)) {
+ Boolean data = (Boolean) value;
+ accelKeyHit = data != null && data.booleanValue ();
+ return;
+ }
/* Remove the key/value pair */
if (value == null) {
if (keys == null) return;