]> git.eshelyaron.com Git - emacs.git/commitdiff
(xmenu_show) {USE_X_TOOLKIT}: ButtonPress no longer pops
authorRichard M. Stallman <rms@gnu.org>
Thu, 7 Jul 1994 19:24:56 +0000 (19:24 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 7 Jul 1994 19:24:56 +0000 (19:24 +0000)
down; instead it forces the next ButtonRelease to exit.  Don't
dispatch on ButtonPress events.

src/xmenu.c

index f5121e2bfedaa588c951c47b487be108fd356bc0..12b76516e8c1a42109715f8f6b1d1219856f3803 100644 (file)
@@ -1416,6 +1416,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
   Position root_x, root_y;
 
   int first_pane;
+  int next_release_must_exit = 0;
 
   *error = NULL;
 
@@ -1655,16 +1656,27 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
                Vmouse_depressed = Qnil;
            }
          if (! (menu_item_selection == 0
+                && !next_release_must_exit
                 && (((XButtonEvent *) (&event))->time - last_event_timestamp
                     < XINT (Vdouble_click_time))))
            break;
+         /* Don't call XtDispatchEvent again for the same event!  */
+         continue;
        }
       else if (event.type == ButtonPress)
        {
+         next_release_must_exit = 1;
+#if 0
+         XtDispatchEvent (&event);
          /* Any mouse button activity that doesn't select in the menu
             should unpost the menu.  */
          if (menu_item_selection == 0)
            break;
+#endif
+         /* Don't call XtDispatchEvent for the down event.
+            Doing so seems to give strange results
+            when you click on the menu bar while a menu is posted.  */
+         continue;
        }
       else if (event.type == KeyPress)
        {