aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuri Linkov2021-09-13 11:14:32 +0300
committerJuri Linkov2021-09-13 11:15:10 +0300
commitfd1379a85aafa77c119b9b7aa811f669c575bac7 (patch)
tree0b293aa0e8f1d55881e465e9e7748b8e9d978542 /src
parent4ee8b4d225176191bc0778ab9cbe5bb481d4704c (diff)
downloademacs-fd1379a85aafa77c119b9b7aa811f669c575bac7.tar.gz
emacs-fd1379a85aafa77c119b9b7aa811f669c575bac7.zip
Support mouse events clicked on the tab bar but outside of any tab (bug#41343)
* lisp/tab-bar.el (tab-bar--key-to-number): Return non-nil non-numeric t when no tab is used. Return nil for current-tab. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab): Do nothing when tab-bar--key-to-number returns non-nil non-numeric t for click events outside of any tab. (tab-bar-mouse-context-menu): Add context menu when mouse is clicked outside of tabs. Add "Duplicate" alongside with "Close" to the menu used when mouse is clicked on a tab. (toggle-tab-bar-mode-from-frame, toggle-frame-tab-bar): Move code closer to 'tab-bar-show'. * src/xdisp.c (handle_tab_bar_click): Return Qtab_bar with empty list when mouse is clicked on the tab bar but outside of any tab.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 45c7090fc00..d30a68570f0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13774,7 +13774,7 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p,
13774 frame_to_window_pixel_xy (w, &x, &y); 13774 frame_to_window_pixel_xy (w, &x, &y);
13775 ts = get_tab_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx, &close_p); 13775 ts = get_tab_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx, &close_p);
13776 if (ts == -1) 13776 if (ts == -1)
13777 return Qnil; 13777 return Fcons (Qtab_bar, Qnil);
13778 13778
13779 /* If item is disabled, do nothing. */ 13779 /* If item is disabled, do nothing. */
13780 enabled_p = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_ENABLED_P); 13780 enabled_p = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_ENABLED_P);