From: Richard M. Stallman Date: Wed, 2 Aug 1995 07:13:45 +0000 (+0000) Subject: (xlw_popup_menu): New arg event. X-Git-Tag: emacs-19.34~3115 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0c7c510c4c280b224e2abfc310225ccfff07fae9;p=emacs.git (xlw_popup_menu): New arg event. --- 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 */