diff src/menubar-msw.c @ 707:a307f9a2021d

[xemacs-hg @ 2001-12-20 05:49:28 by andyp] sync with 21-4-6-windows
author andyp
date Thu, 20 Dec 2001 05:49:48 +0000
parents fdefd0186b75
children 943eaba38521
line wrap: on
line diff
--- a/src/menubar-msw.c	Wed Dec 19 00:40:26 2001 +0000
+++ b/src/menubar-msw.c	Thu Dec 20 05:49:48 2001 +0000
@@ -738,7 +738,7 @@
 
   Lisp_Object path, desc;
   struct gcpro gcpro1;
-
+  
   /* Find which guy is going to explode */
   path = Fgethash (hmenu_to_lisp_object (menu), current_hash_table, Qunbound);
   assert (!UNBOUNDP (path));
@@ -822,8 +822,7 @@
      breaks customize because the misc_event gets eval'ed in some
      circumstances. Don't change it back unless you can fix the
      customize problem also.*/
-  enqueue_misc_user_event (frame, fn, arg);
-  mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE);
+  mswindows_enqueue_misc_user_event (frame, fn, arg);
 
   UNGCPRO; /* data */
   return Qt;
@@ -917,6 +916,8 @@
 	eev = NULL;
     }
 
+  popup_up_p++;
+
   /* Default is to put the menu at the point (10, 10) in frame */
   if (eev)
     {
@@ -932,6 +933,8 @@
   CHECK_CONS (menu_desc);
   CHECK_STRING (XCAR (menu_desc));
 
+  menu_cleanup (f);
+
   current_menudesc = menu_desc;
   current_hash_table =
     make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
@@ -950,7 +953,15 @@
 
   DestroyMenu (menu);
 
-  /* Signal a signal if caught by Track...() modal loop */
+  /* A WM_COMMAND is not issued until TrackPopupMenu returns. This
+     makes setting popup_up_p fairly pointless since we cannot keep
+     the menu up and dispatch events. Furthermore, we seem to have
+     little control over what happens to the menu when we click. */
+  popup_up_p--;
+
+  /* Signal a signal if caught by Track...() modal loop. */
+  /* I think this is pointless, the code hasn't actually put us in a
+     modal loop at this time -- andyp. */
   mswindows_unmodalize_signal_maybe ();
 
   /* This is probably the only real reason for failure */
@@ -961,6 +972,8 @@
 			 menu_desc);
     }
   UNGCPRO;
+
+  return Qnil;
 }