From: Juri Linkov Date: Sun, 12 Jan 2020 23:23:12 +0000 (+0200) Subject: Handle tab-bar clicks on a GPM-capable console. X-Git-Tag: emacs-27.0.90~175 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d47b157969356f15e038dbbfa4da7769f6f98583;p=emacs.git Handle tab-bar clicks on a GPM-capable console. * src/term.c (handle_one_term_event): Call tty_handle_tab_bar_click. * src/xdisp.c (tty_handle_tab_bar_click): Force reset of up_modifier bit from the event modifiers. * lisp/tab-line.el (tab-line-tab-current): No need to use inverse-video on console/xterm because the selected tab already uses inverse-video. --- diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 8e561c71f5b..ef530d43dec 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -81,9 +81,7 @@ '((default :inherit tab-line-tab) (((class color) (min-colors 88)) - :background "grey85") - (t - :inverse-video t)) + :background "grey85")) "Tab line face for tab with current buffer in selected window." :version "27.1" :group 'tab-line-faces) diff --git a/src/term.c b/src/term.c index 871734318c0..a3aef31ec25 100644 --- a/src/term.c +++ b/src/term.c @@ -2568,6 +2568,14 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, else { f->mouse_moved = 0; term_mouse_click (&ie, event, f); + if (tty_handle_tab_bar_click (f, event->x, event->y, + (ie.modifiers & down_modifier) != 0, &ie)) + { + /* tty_handle_tab_bar_click stores 2 events in the event + queue, so we are done here. */ + count += 2; + return count; + } } done: diff --git a/src/xdisp.c b/src/xdisp.c index f3a297a7020..5b21aaa85a9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13516,6 +13516,10 @@ tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, f->last_tab_bar_item = prop_idx; else { + /* Force reset of up_modifier bit from the event modifiers. */ + if (event->modifiers & up_modifier) + event->modifiers &= ~up_modifier; + /* Generate a TAB_BAR_EVENT event. */ Lisp_Object frame; Lisp_Object key = AREF (f->tab_bar_items,