summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2008-09-06 13:43:36 +0000
committerEli Zaretskii <eliz@gnu.org>2008-09-06 13:43:36 +0000
commit2de7397f328dca71014a534fcf1c2a0e14f8f5d5 (patch)
tree83b8a472a79f238faa9dcc70cab7cf6a02198f06 /src/xmenu.c
parent08792c113a276f9b4ae032decfdb0ce1289e1380 (diff)
downloademacs-2de7397f328dca71014a534fcf1c2a0e14f8f5d5.tar.gz
(xmenu_show) [!HAVE_X_WINDOWS]: If frame has a minibuffer, don't let lower
part of menu invade the echo area.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c17
1 files changed, 17 insertions, 0 deletions
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;