Mercurial > emacs
changeset 12746:23cd08c6dd2a
(xm_popup_menu): New arg `event'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 02 Aug 1995 07:14:04 +0000 |
parents | 4da8b8ac5211 |
children | a36d5f3940b5 |
files | lwlib/lwlib-Xm.c |
diffstat | 1 files changed, 16 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/lwlib/lwlib-Xm.c Wed Aug 02 07:13:45 1995 +0000 +++ b/lwlib/lwlib-Xm.c Wed Aug 02 07:14:04 1995 +0000 @@ -1409,23 +1409,26 @@ /* 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) {