]> git.eshelyaron.com Git - emacs.git/commitdiff
(xlw_popup_menu): New arg event.
authorRichard M. Stallman <rms@gnu.org>
Wed, 2 Aug 1995 07:13:45 +0000 (07:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 2 Aug 1995 07:13:45 +0000 (07:13 +0000)
lwlib/lwlib-Xlw.c

index 3c0bd308699a0377da25b94c73d5b4be3576e82b..18a65d99c279ba58651d892c7496b07f7ff1936e 100644 (file)
@@ -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);
+    }
 }
 
 \f/* Destruction of instances */