changeset 15839:e66ccb471d26

(xmenu_show): Set dummy.state. Set dummy.button appropriately. (popup_get_selection) [USE_MOTIF]: Set event.xbutton.button.
author Richard M. Stallman <rms@gnu.org>
date Thu, 08 Aug 1996 17:12:46 +0000
parents 8c89a87a6341
children 1d300843f03c
files src/xmenu.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Wed Aug 07 23:06:08 1996 +0000
+++ b/src/xmenu.c	Thu Aug 08 17:12:46 1996 +0000
@@ -1115,6 +1115,12 @@
         {
           dpyinfo->grabbed &= ~(1 << event.xbutton.button);
           popup_activated_flag = 0;
+#ifdef USE_MOTIF /* Pretending that the event came from a 
+		    Btn1Down seems the only way to convince Motif to
+		    activate its callbacks; setting the XmNmenuPost
+		    isn't working. --marcus@sysc.pdx.edu.  */
+	  event.xbutton.button = 1;
+#endif
         }
       /* If the user presses a key, deactivate the menu.
 	 The user is likely to do that if we get wedged.  */
@@ -1873,7 +1879,7 @@
 /* F is the frame the menu is for.
    X and Y are the frame-relative specified position,
    relative to the inside upper left corner of the frame F.
-   FOR_CLICK if this menu was invoked for a mouse click.
+   FOR_CLICK is nonzero if this menu was invoked for a mouse click.
    KEYMAPS is 1 if this menu was specified with keymaps;
     in that case, we return a list containing the chosen item's value
     and perhaps also the pane's prefix.
@@ -2110,7 +2116,6 @@
   dummy.send_event = 0;
   dummy.display = FRAME_X_DISPLAY (f);
   dummy.time = CurrentTime;
-  dummy.button = 0;
   dummy.root = FRAME_X_DISPLAY_INFO (f)->root_window;
   dummy.window = dummy.root;
   dummy.subwindow = dummy.root;
@@ -2118,6 +2123,11 @@
   dummy.y_root = y;
   dummy.x = x;
   dummy.y = y;
+  dummy.state = (FRAME_X_DISPLAY_INFO (f)->grabbed >> 1) * Button1Mask;
+  dummy.button = 0;
+  for (i = 0; i < 5; i++)
+    if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
+      dummy.button = i;
 
   /* Don't allow any geometry request from the user.  */
   XtSetArg (av[ac], XtNgeometry, 0); ac++;