diff options
| author | Carolyn MacLeod | 2012-03-09 22:40:50 +0000 |
|---|---|---|
| committer | Carolyn MacLeod | 2012-03-10 21:42:22 +0000 |
| commit | cfe6ffcea1d99dc4b4ce3146d2ad4b9c767e7566 (patch) | |
| tree | 305c1dd0a5824e057727398333cf78d484a9c3ab | |
| parent | 43e07e7c95cb3522a72787415e72350f2cd8a6da (diff) | |
| download | eclipse.platform.swt-cfe6ffcea1d99dc4b4ce3146d2ad4b9c767e7566.tar.gz eclipse.platform.swt-cfe6ffcea1d99dc4b4ce3146d2ad4b9c767e7566.tar.xz eclipse.platform.swt-cfe6ffcea1d99dc4b4ce3146d2ad4b9c767e7566.zip | |
bug 110005 Mac
4 files changed, 9 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 10c005e006..7914898d6a 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,6 +1750,9 @@ void textEvent (Event event) { case SWT.MenuDetect: { Event e = new Event (); e.time = event.time; + e.x = event.x; + e.y = event.y; + e.detail = event.detail; notifyListeners (SWT.MenuDetect, e); break; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java index 26c7ba8b84..b778e836ea 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java @@ -2418,6 +2418,7 @@ int /*long*/ menuForEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ theEv Event event = new Event (); event.x = x; event.y = y; + event.detail = SWT.MENU_MOUSE; sendEvent (SWT.MenuDetect, event); //widget could be disposed at this point if (isDisposed ()) return 0; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java index adffc449f9..dfe3a59bd5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java @@ -270,6 +270,7 @@ void _setVisible (boolean visible) { } else { location = window.mouseLocationOutsideOfEventStream(); } + hasLocation = false; // Hold on to window in case it is disposed while the popup is open. window.retain(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 2f3e1a0e8d..a07074face 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -1032,19 +1032,19 @@ public class SWT { /** * MenuDetect event detail value indicating that a context menu - * was requested by a mouse or other pointing device (value is 1<<1). + * was requested by a mouse or other pointing device (value is 0). * * @since 3.8 */ - public static final int MENU_MOUSE = 1 << 1; + public static final int MENU_MOUSE = 0; /** * MenuDetect event detail value indicating that a context menu - * was requested by a keyboard or other focus-based device (value is 1<<2). + * was requested by a keyboard or other focus-based device (value is 1). * * @since 3.8 */ - public static final int MENU_KEYBOARD = 1 << 2; + public static final int MENU_KEYBOARD = 1; /** * A constant indicating that widgets have changed. |
