From 2de7397f328dca71014a534fcf1c2a0e14f8f5d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Sep 2008 13:43:36 +0000 Subject: [PATCH] (xmenu_show) [!HAVE_X_WINDOWS]: If frame has a minibuffer, don't let lower part of menu invade the echo area. --- src/ChangeLog | 3 +++ src/xmenu.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 018bcd399c1..27473dd0f66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-09-06 Eli Zaretskii + * xmenu.c (xmenu_show) [!HAVE_X_WINDOWS]: If frame has a + minibuffer, don't let lower part of menu invade the echo area. + * msdos.c (IT_menu_display): Use STRING_CHAR_ADVANCE instead of a "char *q" to access menu text and advance through it. Revert the change that displayed ">" instead of ASCII character 0x10. diff --git a/src/xmenu.c b/src/xmenu.c index fee66df9c0d..5cc92422007 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2775,6 +2775,23 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) y -= (uly + height) - dispheight; uly = dispheight - height; } +#ifndef HAVE_X_WINDOWS + if (FRAME_HAS_MINIBUF_P (f) && uly+height > dispheight - 1) + { + /* Move the menu away of the echo area, to avoid overwriting the + menu with help echo messages or vice versa. */ + if (BUFFERP (echo_area_buffer[0]) && WINDOWP (echo_area_window)) + { + y -= WINDOW_TOTAL_LINES (XWINDOW (echo_area_window)); + uly -= WINDOW_TOTAL_LINES (XWINDOW (echo_area_window)); + } + else + { + y--; + uly--; + } + } +#endif if (ulx < 0) x -= ulx; if (uly < 0) y -= uly; -- 2.39.5