]> code.delx.au - gnu-emacs/blobdiff - lwlib/lwlib-Xlw.c
(help-xref-interned): make it also work on variable-only and
[gnu-emacs] / lwlib / lwlib-Xlw.c
index 3c0bd308699a0377da25b94c73d5b4be3576e82b..a927d40bf25fd82ed60fffbf00a772b44d77a8c2 100644 (file)
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include "lwlib-Xlw.h"
 #include <X11/StringDefs.h>
@@ -185,8 +186,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 +198,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 */