From 72dd9119819eea5d8b1138e14a6010759f38366b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 16 Oct 2020 10:02:50 +0300 Subject: Fix posn-at-x-y in builds --without-x * src/keyboard.c (make_lispy_position): Don't exclude the window_or_frame = frame case from TTY-only builds. Reported by Jared Finder . * doc/lispref/commands.texi (Click Events): Document the format of POSITION in click events on the frame's internal border. --- src/keyboard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index 5f136f03ecf..fca71985b92 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5246,7 +5246,6 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, extra_info))); } -#ifdef HAVE_WINDOW_SYSTEM else if (f) { /* Return mouse pixel coordinates here. */ @@ -5254,7 +5253,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, xret = XFIXNUM (x); yret = XFIXNUM (y); - if (FRAME_LIVE_P (f) +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f) + && FRAME_LIVE_P (f) && FRAME_INTERNAL_BORDER_WIDTH (f) > 0 && !NILP (get_frame_param (f, Qdrag_internal_border))) { @@ -5263,8 +5264,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, posn = builtin_lisp_symbol (internal_border_parts[part]); } - } #endif + } else window_or_frame = Qnil; -- cgit v1.2.1 From e29cace60afdab04ff20c4f4043a3ee64ec9d01d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 21 Oct 2020 18:32:51 +0300 Subject: Avoid rare crashes while producing line numbers * src/xdisp.c (maybe_produce_line_number): Prevent freeing of realized faces for as long as we are using lnum_face_id and current_lnum_face_id for producing glyphs. (Bug#44111) --- src/xdisp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 6c401d0abb9..03dc4bec712 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22793,6 +22793,10 @@ maybe_produce_line_number (struct it *it) int lnum_face_id = merge_faces (it->w, Qline_number, 0, DEFAULT_FACE_ID); int current_lnum_face_id = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID); + /* From here onwards, we must prevent freeing realized faces, because + we are using the above 2 face IDs for the glyphs we produce. */ + bool save_free_realized_faces = inhibit_free_realized_faces; + inhibit_free_realized_faces = true; /* Compute point's line number if needed. */ if ((EQ (Vdisplay_line_numbers, Qrelative) || EQ (Vdisplay_line_numbers, Qvisual) @@ -22922,10 +22926,13 @@ maybe_produce_line_number (struct it *it) it->lnum_width = 0; it->lnum_pixel_width = 0; bidi_unshelve_cache (itdata, false); + inhibit_free_realized_faces = save_free_realized_faces; return; } } + inhibit_free_realized_faces = save_free_realized_faces; + /* Record the width in pixels we need for the line number display. */ it->lnum_pixel_width = tem_it.current_x; /* Copy the produced glyphs into IT's glyph_row. */ -- cgit v1.2.1