summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-08-02 07:13:45 +0000
committerRichard M. Stallman <rms@gnu.org>1995-08-02 07:13:45 +0000
commit0c7c510c4c280b224e2abfc310225ccfff07fae9 (patch)
tree4f783427b9191e6647e79c5a25eef734f1d22699 /lwlib
parent5b3b31d6080cb1946ef923f65c7b98906fb5c2cb (diff)
downloademacs-0c7c510c4c280b224e2abfc310225ccfff07fae9.tar.gz
(xlw_popup_menu): New arg event.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/lwlib-Xlw.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index 3c0bd308699..18a65d99c27 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -185,8 +185,9 @@ xlw_pop_instance (instance, up)
}
void
-xlw_popup_menu (widget)
+xlw_popup_menu (widget, event)
Widget widget;
+ XEvent *event;
{
XButtonPressedEvent dummy;
XlwMenuWidget mw;
@@ -196,18 +197,23 @@ xlw_popup_menu (widget)
mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
- dummy.type = ButtonPress;
- dummy.serial = 0;
- dummy.send_event = 0;
- dummy.display = XtDisplay (widget);
- dummy.window = XtWindow (XtParent (widget));
- dummy.time = CurrentTime;
- dummy.button = 0;
- XQueryPointer (dummy.display, dummy.window, &dummy.root,
- &dummy.subwindow, &dummy.x_root, &dummy.y_root,
- &dummy.x, &dummy.y, &dummy.state);
-
- pop_up_menu (mw, &dummy);
+ if (event)
+ pop_up_menu (mw, event);
+ else
+ {
+ dummy.type = ButtonPress;
+ dummy.serial = 0;
+ dummy.send_event = 0;
+ dummy.display = XtDisplay (widget);
+ dummy.window = XtWindow (XtParent (widget));
+ dummy.time = CurrentTime;
+ dummy.button = 0;
+ XQueryPointer (dummy.display, dummy.window, &dummy.root,
+ &dummy.subwindow, &dummy.x_root, &dummy.y_root,
+ &dummy.x, &dummy.y, &dummy.state);
+
+ pop_up_menu (mw, &dummy);
+ }
}
/* Destruction of instances */