From 1cb14aaba57e5842403733650cef99022a3f8667 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 21 Feb 2020 10:50:08 -0500 Subject: [PATCH] * src/keyboard.c: Copy last tool-bar change to tab-bar. (make_lispy_event) : Make event with proper location info. * src/xdisp.c (handle_tab_bar_click, tty_handle_tab_bar_click): Don't emit dummy "prefix" event. --- src/keyboard.c | 13 +++---------- src/xdisp.c | 10 ---------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 913a4d344b2..9ce168c6dd0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5998,20 +5998,13 @@ make_lispy_event (struct input_event *event) return list2 (Qselect_window, list1 (event->frame_or_window)); case TAB_BAR_EVENT: - if (EQ (event->arg, event->frame_or_window)) - /* This is the prefix key. We translate this to - `(tab_bar)' because the code in keyboard.c for tab bar - events, which we use, relies on this. */ - return list1 (Qtab_bar); - else if (SYMBOLP (event->arg)) - return apply_modifiers (event->modifiers, event->arg); - return event->arg; - case TOOL_BAR_EVENT: { Lisp_Object res = event->arg; + Lisp_Object location + = event->kind == TAB_BAR_EVENT ? Qtab_bar : Qtool_bar; if (SYMBOLP (res)) res = apply_modifiers (event->modifiers, res); - return list2 (res, list2 (event->frame_or_window, Qtool_bar)); + return list2 (res, list2 (event->frame_or_window, location)); } case USER_SIGNAL_EVENT: diff --git a/src/xdisp.c b/src/xdisp.c index 682399f13e7..c2aa314c1ad 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13356,11 +13356,6 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, key = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_KEY); XSETFRAME (frame, f); - event.kind = TAB_BAR_EVENT; - event.frame_or_window = frame; - event.arg = frame; - kbd_buffer_store_event (&event); - event.kind = TAB_BAR_EVENT; event.frame_or_window = frame; event.arg = key; @@ -13536,11 +13531,6 @@ tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, event->code = 0; XSETFRAME (frame, f); - event->kind = TAB_BAR_EVENT; - event->frame_or_window = frame; - event->arg = frame; - kbd_buffer_store_event (event); - event->kind = TAB_BAR_EVENT; event->frame_or_window = frame; event->arg = key; -- 2.39.2