summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
diff options
context:
space:
mode:
authorCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-03-10 13:15:23 -0500
committerCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-03-10 16:42:25 -0500
commitd4768e1203a5077ab3bf6ed0bdc55f1be7dbe216 (patch)
tree4da48c39b0c2efe9635d40c0b258f751980a21f1 /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
parentcfe6ffcea1d99dc4b4ce3146d2ad4b9c767e7566 (diff)
downloadeclipse.platform.swt-d4768e1203a5077ab3bf6ed0bdc55f1be7dbe216.tar.gz
eclipse.platform.swt-d4768e1203a5077ab3bf6ed0bdc55f1be7dbe216.tar.xz
eclipse.platform.swt-d4768e1203a5077ab3bf6ed0bdc55f1be7dbe216.zip
Mac VoiceOver calls menuForEvent. Fix CCombo.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java4
2 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
index 7914898d6a..f835690345 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
@@ -1750,10 +1750,18 @@ void textEvent (Event event) {
case SWT.MenuDetect: {
Event e = new Event ();
e.time = event.time;
+ e.detail = event.detail;
e.x = event.x;
e.y = event.y;
- e.detail = event.detail;
+ if (event.detail == SWT.MENU_KEYBOARD) {
+ Point pt = getDisplay().map(text, null, text.getCaretLocation());
+ e.x = pt.x;
+ e.y = pt.y;
+ }
notifyListeners (SWT.MenuDetect, e);
+ event.doit = e.doit;
+ event.x = e.x;
+ event.y = e.y;
break;
}
case SWT.Modify: {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 78bf72f3cb..9dc35aba62 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -5969,9 +5969,7 @@ void handleKeyUp(Event event) {
*/
void handleMenuDetect(Event event) {
if (event.detail == SWT.MENU_KEYBOARD) {
- Point point = getPointAtOffset(caretOffset);
- Display display = getDisplay();
- point = display.map(this, null, point);
+ Point point = getDisplay().map(this, null, getPointAtOffset(caretOffset));
event.x = point.x;
event.y = point.y;
}