From: Richard M. Stallman Date: Wed, 2 Aug 1995 07:14:04 +0000 (+0000) Subject: (xm_popup_menu): New arg `event'. X-Git-Tag: emacs-19.34~3114 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=86c42dbd6d11ef3bee9444d8bb6f7f6efbbfe796;p=emacs.git (xm_popup_menu): New arg `event'. --- 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) {