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/w32term.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/w32term.c')
| -rw-r--r-- | src/w32term.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/w32term.c b/src/w32term.c index c9570b0c670..aca4739a2e3 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5186,7 +5186,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5186 | { | 5186 | { |
| 5187 | /* If we decide we want to generate an event to be seen | 5187 | /* If we decide we want to generate an event to be seen |
| 5188 | by the rest of Emacs, we put it here. */ | 5188 | by the rest of Emacs, we put it here. */ |
| 5189 | Lisp_Object tab_bar_key = Qnil; | 5189 | Lisp_Object tab_bar_arg = Qnil; |
| 5190 | bool tab_bar_p = 0; | 5190 | bool tab_bar_p = 0; |
| 5191 | bool tool_bar_p = 0; | 5191 | bool tool_bar_p = 0; |
| 5192 | int button = 0; | 5192 | int button = 0; |
| @@ -5209,12 +5209,12 @@ w32_read_socket (struct terminal *terminal, | |||
| 5209 | 5209 | ||
| 5210 | if (EQ (window, f->tab_bar_window)) | 5210 | if (EQ (window, f->tab_bar_window)) |
| 5211 | { | 5211 | { |
| 5212 | tab_bar_key = w32_handle_tab_bar_click (f, &inev); | 5212 | tab_bar_arg = w32_handle_tab_bar_click (f, &inev); |
| 5213 | tab_bar_p = 1; | 5213 | tab_bar_p = 1; |
| 5214 | } | 5214 | } |
| 5215 | } | 5215 | } |
| 5216 | 5216 | ||
| 5217 | if ((tab_bar_p && NILP (tab_bar_key)) | 5217 | if ((tab_bar_p && NILP (tab_bar_arg)) |
| 5218 | || (dpyinfo->w32_focus_frame | 5218 | || (dpyinfo->w32_focus_frame |
| 5219 | && f != dpyinfo->w32_focus_frame | 5219 | && f != dpyinfo->w32_focus_frame |
| 5220 | /* This does not help when the click happens in | 5220 | /* This does not help when the click happens in |
| @@ -5222,8 +5222,8 @@ w32_read_socket (struct terminal *terminal, | |||
| 5222 | && !frame_ancestor_p (f, dpyinfo->w32_focus_frame))) | 5222 | && !frame_ancestor_p (f, dpyinfo->w32_focus_frame))) |
| 5223 | inev.kind = NO_EVENT; | 5223 | inev.kind = NO_EVENT; |
| 5224 | 5224 | ||
| 5225 | if (!NILP (tab_bar_key)) | 5225 | if (!NILP (tab_bar_arg)) |
| 5226 | inev.arg = tab_bar_key; | 5226 | inev.arg = tab_bar_arg; |
| 5227 | 5227 | ||
| 5228 | /* Is this in the tool-bar? */ | 5228 | /* Is this in the tool-bar? */ |
| 5229 | if (WINDOWP (f->tool_bar_window) | 5229 | if (WINDOWP (f->tool_bar_window) |