summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-09-05 20:16:33 +0300
committerJuri Linkov <juri@linkov.net>2021-09-05 20:16:33 +0300
commit794fdce55d097f2b58ce37818edffb2deef7b9de (patch)
tree42c14ae6326ae151f3e943d264074a2671ccda98 /src/menu.c
parentad9c57f54ae3eea9e5b2fe9264e9edb8b2ed1857 (diff)
downloademacs-794fdce55d097f2b58ce37818edffb2deef7b9de.tar.gz
emacs-794fdce55d097f2b58ce37818edffb2deef7b9de.tar.bz2
emacs-794fdce55d097f2b58ce37818edffb2deef7b9de.zip
Improve tab-bar event handling (bug#41343)
* lisp/tab-bar.el (tab-bar--key-to-number): Rename from tab--key-to-number. (tab-bar--event-to-item): New function from tab-bar-handle-mouse. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab) (tab-bar-mouse-context-menu, tab-bar-mouse-move-tab): Use tab-bar--event-to-item. * src/menu.c (x_popup_menu_1): Handle Qtab_bar in the second list element. * src/xdisp.c (tty_get_tab_bar_item): Change arg 'end' to bool 'close_p'. (tty_get_tab_bar_item): Detect if the close button was clicked. (tty_handle_tab_bar_click): Return a list with caption that has text properties.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/menu.c b/src/menu.c
index 3b1d7402571..990a74b92e3 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1127,9 +1127,12 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
/* Decode the first argument: find the window and the coordinates. */
if (EQ (position, Qt)
- || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
- || EQ (XCAR (position), Qtab_bar)
- || EQ (XCAR (position), Qtool_bar))))
+ || (CONSP (position)
+ && (EQ (XCAR (position), Qmenu_bar)
+ || EQ (XCAR (position), Qtab_bar)
+ || (CONSP (XCDR (position))
+ && EQ (XCAR (XCDR (position)), Qtab_bar))
+ || EQ (XCAR (position), Qtool_bar))))
{
get_current_pos_p = 1;
}