From 3b4bd4be1dfa8717cb6911bd57c4c7d9d13614b4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 21 Feb 2020 10:13:21 -0500 Subject: [PATCH] * src/keyboard.c (make_lispy_event): Generate proper tool-bar events. Generate events which carry the location info. * src/xdisp.c (handle_tool_bar_click): Don't emit dummy "prefix" events. --- src/keyboard.c | 13 +++++-------- src/xdisp.c | 9 ++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 9dd7e00709e..913a4d344b2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6008,14 +6008,11 @@ make_lispy_event (struct input_event *event) return event->arg; case TOOL_BAR_EVENT: - if (EQ (event->arg, event->frame_or_window)) - /* This is the prefix key. We translate this to - `(tool_bar)' because the code in keyboard.c for tool bar - events, which we use, relies on this. */ - return list1 (Qtool_bar); - else if (SYMBOLP (event->arg)) - return apply_modifiers (event->modifiers, event->arg); - return event->arg; + { + Lisp_Object res = event->arg; + if (SYMBOLP (res)) res = apply_modifiers (event->modifiers, res); + return list2 (res, list2 (event->frame_or_window, Qtool_bar)); + } case USER_SIGNAL_EVENT: /* A user signal. */ diff --git a/src/xdisp.c b/src/xdisp.c index e41ceaf0bb7..682399f13e7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14322,11 +14322,6 @@ handle_tool_bar_click (struct frame *f, int x, int y, bool down_p, key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); XSETFRAME (frame, f); - event.kind = TOOL_BAR_EVENT; - event.frame_or_window = frame; - event.arg = frame; - kbd_buffer_store_event (&event); - event.kind = TOOL_BAR_EVENT; event.frame_or_window = frame; event.arg = key; @@ -29230,7 +29225,7 @@ produce_stretch_glyph (struct it *it) /* Compute the width of the stretch. */ if ((prop = Fplist_get (plist, QCwidth), !NILP (prop)) - && calc_pixel_width_or_height (&tem, it, prop, font, true, 0)) + && calc_pixel_width_or_height (&tem, it, prop, font, true, NULL)) { /* Absolute width `:width WIDTH' specified and valid. */ zero_width_ok_p = true; @@ -29286,7 +29281,7 @@ produce_stretch_glyph (struct it *it) int default_height = normal_char_height (font, ' '); if ((prop = Fplist_get (plist, QCheight), !NILP (prop)) - && calc_pixel_width_or_height (&tem, it, prop, font, false, 0)) + && calc_pixel_width_or_height (&tem, it, prop, font, false, NULL)) { height = (int)tem; zero_height_ok_p = true; -- 2.39.2