Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2012-03-10 20:24:46 +0000
committerCarolyn MacLeod2012-03-10 21:42:32 +0000
commit5e82c59354dbb6becb1ba85948232d6cfb5caae9 (patch)
treebb7e8ee6df7bbe832184686f31cb00c77cd6b150
parent832d9f88ad5aef2846c1369515369946b39ad5f1 (diff)
downloadeclipse.platform.swt-5e82c59354dbb6becb1ba85948232d6cfb5caae9.tar.gz
eclipse.platform.swt-5e82c59354dbb6becb1ba85948232d6cfb5caae9.tar.xz
eclipse.platform.swt-5e82c59354dbb6becb1ba85948232d6cfb5caae9.zip
Gtk bug 110005
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java1
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 73fad3ecae..c6f013ead7 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) {
@@ -4587,9 +4587,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 2e82f0ecf3..0f072e2925 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
@@ -209,6 +209,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))) {
/*

Back to the top