From 7ace926507379e836df263c4a0310eed285181c6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 22 Sep 2013 18:23:06 +0300 Subject: [PATCH] Half-solution for menus popped up by mouse clicks. --- src/keyboard.c | 2 +- src/term.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index c029239b446..4ace767484e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1716,7 +1716,7 @@ read_menu_command (void) if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); if (i == 0 || i == -1) - return Qnil; + return Qt; return read_key_sequence_cmd; } diff --git a/src/term.c b/src/term.c index d0fd0722da1..26fa64da62d 100644 --- a/src/term.c +++ b/src/term.c @@ -3176,11 +3176,15 @@ read_menu_input (struct frame *sf, int *x, int *y, bool *first_time) { #if 1 extern Lisp_Object read_menu_command (void); - Lisp_Object cmd = read_menu_command (); + Lisp_Object cmd; int usable_input = 1; int st = 0; - if (NILP (cmd)) + do { + cmd = read_menu_command (); + } while NILP (cmd); + + if (EQ (cmd, Qt)) return -1; if (EQ (cmd, Qright_char) || EQ (cmd, Qforward_char)) *x += 1; -- 2.39.2