diff options
author | Carolyn MacLeod | 2012-03-10 20:24:46 +0000 |
---|---|---|
committer | Carolyn MacLeod | 2012-03-10 20:24:46 +0000 |
commit | f72d6d52d8ecaf34fad5a0d31cdf4adf6b42781c (patch) | |
tree | 82df12c1b8f08a93a5610e1f3f58042fb51574b9 | |
parent | 7d61feb82a1dfb050077da304e140a849c22b02c (diff) | |
download | eclipse.platform.swt-carolyn/bug110005.tar.gz eclipse.platform.swt-carolyn/bug110005.tar.xz eclipse.platform.swt-carolyn/bug110005.zip |
Gtk bug 110005carolyn/bug110005
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 7 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 14d20d03d2..2c336bc3e2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -3119,7 +3119,7 @@ int /*long*/ gtk_popup_menu (int /*long*/ widget) { if (!hasFocus()) return 0; int [] x = new int [1], y = new int [1]; OS.gdk_window_get_pointer (0, x, y, null); - return showMenu (x [0], y [0]) ? 1 : 0; + return showMenu (x [0], y [0], SWT.MENU_KEYBOARD) ? 1 : 0; } int /*long*/ gtk_preedit_changed (int /*long*/ imcontext) { @@ -4586,9 +4586,14 @@ void setWidgetBackground () { } boolean showMenu (int x, int y) { + return showMenu (x, y, SWT.MENU_MOUSE); +} + +boolean showMenu (int x, int y, int detail) { Event event = new Event (); event.x = x; event.y = y; + event.detail = detail; sendEvent (SWT.MenuDetect, event); //widget could be disposed at this point if (isDisposed ()) return false; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index b69ac67e75..2767ef2ae5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -210,6 +210,7 @@ void _setVisible (boolean visible) { } } int /*long*/ address = hasLocation ? display.menuPositionProc: 0; + hasLocation = false; int /*long*/ data = 0; if ((OS.GTK_VERSION >= OS.VERSION (2, 10, 0))) { /* |