diff options
author | Felipe Heidrich <fheidric> | 2003-07-16 19:56:02 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2003-07-16 19:56:02 +0000 |
commit | 1937a10e0bc79448f14680b49f505016659fc4ac (patch) | |
tree | 64baeea85a199d5db173545d9378e4e18333ba0b | |
parent | 1a4b27d5a02230d629dc664520779c840b66b2db (diff) | |
download | eclipse.platform.swt-1937a10e0bc79448f14680b49f505016659fc4ac.tar.gz eclipse.platform.swt-1937a10e0bc79448f14680b49f505016659fc4ac.tar.xz eclipse.platform.swt-1937a10e0bc79448f14680b49f505016659fc4ac.zip |
*** empty log message ***
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 5 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java | 14 |
2 files changed, 4 insertions, 15 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 ffb03147a8..8b329c67ed 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 @@ -1602,7 +1602,10 @@ int gtk_button_press_event (int widget, int event) { display.dragging = false; int result = 0; if (gdkEvent.button == 3 && gdkEvent.type == OS.GDK_BUTTON_PRESS) { - if (showMenu ((int)gdkEvent.x, (int)gdkEvent.y)) { + int window = OS.GTK_WIDGET_WINDOW (widget); + int [] origin_x = new int [1], origin_y = new int [1]; + OS.gdk_window_get_origin (window, origin_x, origin_y); + if (showMenu (origin_x [0] + (int)gdkEvent.x, origin_y [0] + (int)gdkEvent.y)) { result = 1; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java index ddd331e799..90c239eb47 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java @@ -475,19 +475,6 @@ int gtk_enter_notify_event (int widget, int event) { return 0; } -int gtk_event_after (int widget, int event) { - GdkEvent gdkEvent = new GdkEvent (); - OS.memmove (gdkEvent, event, GdkEvent.sizeof); - Menu menu = parent.menu; - if (menu != null && gdkEvent.type == OS.GDK_BUTTON_PRESS) { - GdkEventButton gdkEventButton = new GdkEventButton (); - OS.memmove (gdkEventButton, event, GdkEventButton.sizeof); - int button = gdkEventButton.button; - if (button == 3) menu.setVisible (true); - } - return 0; -} - int gtk_leave_notify_event (int widget, int event) { if (drawHotImage) { drawHotImage = false; @@ -524,7 +511,6 @@ void hookEvents () { OS.gtk_widget_add_events (handle, mask); OS.g_signal_connect (handle, OS.button_press_event, windowProc3, BUTTON_PRESS_EVENT); OS.g_signal_connect (handle, OS.button_release_event, windowProc3, BUTTON_RELEASE_EVENT); - OS.g_signal_connect (handle, OS.event_after, windowProc3, EVENT_AFTER); } /** |