]> git.eshelyaron.com Git - emacs.git/commit
Implement surrogate menu bars for tty child frames
authorMartin Rudalics <rudalics@gmx.at>
Mon, 17 Mar 2025 08:36:59 +0000 (09:36 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 17 Mar 2025 11:06:14 +0000 (12:06 +0100)
commitff188fedb1b1a4d0502e366c417e3000c5bf5371
tree8e7db572a02710a448d38c4321d5b391c6012ff1
parent85009cfba687e296710965994753dbfd7bc8c3b0
Implement surrogate menu bars for tty child frames

* lisp/menu-bar.el (popup-menu): When asked to pop up MENU from
a tty child frame try to use menu of its root frame.
(menu-bar-open): When FRAME is a child frame and
'tty-menu-open-use-tmm' is nil, navigate menu bar of its root
frame.
* src/keymap.c (Fcurrent_active_maps): Accept live window as
POSITION argument and use its buffer as current when processing
the key sequence.  Needed for tty child frames so the root
frame's menu bar can be updated according to the selected
window's buffer when navigating the menu bar from keyboard.
* src/xdisp.c (prepare_menu_bars): If the selected window's
frame is a tty child frame without menu bar, that frame's root
frame has a menu bar and 'tty-menu-open-use-tmm' is nil, prepare
to update the menu bar of the root frame as surrogate.
(update_menu_bar): New argument W denoting the window that
should be considered as selected.  For a tty child frame using F
as surrogate menu bar frame this specifies the child frame's
selected window and its buffer shall be used for updating the
menu bar of the root frame instead of the buffer of the root
frame's selected window.
(redisplay_window): Instead of setting redisplay_menu_p flag
always call display_menu_bar right away.  This facilitates to
call display_menu_bar for a tty child frame with its root
frame as surrogate menu bar frame.
(display_tty_menu_item): If the selected frame is a tty child
frame, overwrite its root frame's glyph matrix (and not that of
the child frame) when displaying a menu item.
(Qtty_menu_open_use_tmm): Define symbol.

(cherry picked from commit 7e71b0a2c938623872ec7404d81339c8ff51b012)
lisp/menu-bar.el
src/keymap.c
src/xdisp.c