diff options
| author | Juri Linkov | 2021-09-05 20:16:33 +0300 |
|---|---|---|
| committer | Juri Linkov | 2021-09-05 20:16:33 +0300 |
| commit | 794fdce55d097f2b58ce37818edffb2deef7b9de (patch) | |
| tree | 42c14ae6326ae151f3e943d264074a2671ccda98 /src/menu.c | |
| parent | ad9c57f54ae3eea9e5b2fe9264e9edb8b2ed1857 (diff) | |
| download | emacs-794fdce55d097f2b58ce37818edffb2deef7b9de.tar.gz 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.c | 9 |
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) | |||
| 1127 | 1127 | ||
| 1128 | /* Decode the first argument: find the window and the coordinates. */ | 1128 | /* Decode the first argument: find the window and the coordinates. */ |
| 1129 | if (EQ (position, Qt) | 1129 | if (EQ (position, Qt) |
| 1130 | || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar) | 1130 | || (CONSP (position) |
| 1131 | || EQ (XCAR (position), Qtab_bar) | 1131 | && (EQ (XCAR (position), Qmenu_bar) |
| 1132 | || EQ (XCAR (position), Qtool_bar)))) | 1132 | || EQ (XCAR (position), Qtab_bar) |
| 1133 | || (CONSP (XCDR (position)) | ||
| 1134 | && EQ (XCAR (XCDR (position)), Qtab_bar)) | ||
| 1135 | || EQ (XCAR (position), Qtool_bar)))) | ||
| 1133 | { | 1136 | { |
| 1134 | get_current_pos_p = 1; | 1137 | get_current_pos_p = 1; |
| 1135 | } | 1138 | } |