diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-08-02 07:14:04 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-08-02 07:14:04 +0000 |
commit | 6daba0c7e171e3ad02c05bb64d1d11a58c43702a (patch) | |
tree | 8356904dcc5f1ee5d102363ec6671589ec5c86aa /lwlib/lwlib-Xm.c | |
parent | 6c4c48d30c53a36904af4396c5052833ea92c049 (diff) | |
download | emacs-6daba0c7e171e3ad02c05bb64d1d11a58c43702a.tar.gz |
(xm_popup_menu): New arg `event'.
Diffstat (limited to 'lwlib/lwlib-Xm.c')
-rw-r--r-- | lwlib/lwlib-Xm.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 48730c501c2..797945055f7 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -1409,23 +1409,26 @@ xm_destroy_instance (instance) /* popup utility */ void -xm_popup_menu (widget) +xm_popup_menu (widget, event) Widget widget; + XEvent *event; { XButtonPressedEvent dummy; - XEvent* event; - - dummy.type = ButtonPress; - dummy.serial = 0; - dummy.send_event = 0; - dummy.display = XtDisplay (widget); - dummy.window = XtWindow (XtParent (widget)); - dummy.time = 0; - dummy.button = 0; - XQueryPointer (dummy.display, dummy.window, &dummy.root, - &dummy.subwindow, &dummy.x_root, &dummy.y_root, - &dummy.x, &dummy.y, &dummy.state); - event = (XEvent *) &dummy; + + if (event == 0) + { + dummy.type = ButtonPress; + dummy.serial = 0; + dummy.send_event = 0; + dummy.display = XtDisplay (widget); + dummy.window = XtWindow (XtParent (widget)); + dummy.time = 0; + dummy.button = 0; + XQueryPointer (dummy.display, dummy.window, &dummy.root, + &dummy.subwindow, &dummy.x_root, &dummy.y_root, + &dummy.x, &dummy.y, &dummy.state); + event = (XEvent *) &dummy; + } if (event->type == ButtonPress || event->type == ButtonRelease) { |