changeset 59155:6690f246cffe

* xmenu.c (popup_get_selection): Only pop down dialogs on C-g and Escape.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 27 Dec 2004 20:34:03 +0000
parents 6149cfdba3ab
children 03a6e350cf4d
files src/ChangeLog src/xmenu.c
diffstat 2 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Dec 27 20:16:58 2004 +0000
+++ b/src/ChangeLog	Mon Dec 27 20:34:03 2004 +0000
@@ -1,3 +1,8 @@
+2004-12-27  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xmenu.c (popup_get_selection): Only pop down dialogs
+	on C-g and Escape.
+
 2004-12-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* dispextern.h: Change HAVE_CARBON to MAC_OS.
--- a/src/xmenu.c	Mon Dec 27 20:16:58 2004 +0000
+++ b/src/xmenu.c	Mon Dec 27 20:34:03 2004 +0000
@@ -1232,25 +1232,16 @@
           event.xbutton.state = 0;
 #endif
         }
-      /* If the user presses a key that doesn't go to the menu,
-         deactivate the menu.
-         The user is likely to do that if we get wedged.
-         All toolkits now pop down menus on ESC.
-         For dialogs however, the focus may not be on the dialog, so
-         in that case, we pop down. */
+      /* Pop down on C-g and Escape.  */
       else if (event.type == KeyPress
                && down_on_keypress
                && dpyinfo->display == event.xbutton.display)
         {
           KeySym keysym = XLookupKeysym (&event.xkey, 0);
 
-          /* Pop down on C-g.  */
-          if (keysym == XK_g && (event.xkey.state & ControlMask) != 0)
+          if ((keysym == XK_g && (event.xkey.state & ControlMask) != 0)
+              || keysym == XK_Escape) /* Any escape, ignore modifiers.  */
             popup_activated_flag = 0;
-
-          if (!IsModifierKey (keysym)
-              && x_any_window_to_frame (dpyinfo, event.xany.window) != NULL)
-	    popup_activated_flag = 0;
         }
 
       x_dispatch_event (&event, event.xany.display);