From 8a0484e105fcb4a7d6904f7a904003456e9ec913 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 24 Jul 2012 19:34:15 +0300 Subject: [PATCH] Fix display of tooltips damaged by enhancements for bug #11832. src/xdisp.c (init_iterator): Don't compute dimensions of truncation and continuation glyphs on tooltip frames, leave them at zero. Avoids displaying continued lines in tooltips. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 31 ++++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 833fd8cc3c4..a7ed81da2d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-07-24 Eli Zaretskii + + * xdisp.c (init_iterator): Don't compute dimensions of truncation + and continuation glyphs on tooltip frames, leave them at zero. + Avoids continued lines in tooltips. (Bug#11832) + 2012-07-24 Dmitry Antipov Simplify copy_overlay. diff --git a/src/xdisp.c b/src/xdisp.c index 4d77b56ad55..1d3de61c5a3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2733,20 +2733,25 @@ init_iterator (struct it *it, struct window *w, /* Get dimensions of truncation and continuation glyphs. These are displayed as fringe bitmaps under X, but we need them for such - frames when the fringes are turned off. */ - if (it->line_wrap == TRUNCATE) + frames when the fringes are turned off. But leave the dimensions + zero for tooltip frames, as these glyphs look ugly there and also + sabotage calculations of tooltip dimensions in x-show-tip. */ + if (!(FRAMEP (tip_frame) && it->f == XFRAME (tip_frame))) { - /* We will need the truncation glyph. */ - eassert (it->glyph_row == NULL); - produce_special_glyphs (it, IT_TRUNCATION); - it->truncation_pixel_width = it->pixel_width; - } - else - { - /* We will need the continuation glyph. */ - eassert (it->glyph_row == NULL); - produce_special_glyphs (it, IT_CONTINUATION); - it->continuation_pixel_width = it->pixel_width; + if (it->line_wrap == TRUNCATE) + { + /* We will need the truncation glyph. */ + eassert (it->glyph_row == NULL); + produce_special_glyphs (it, IT_TRUNCATION); + it->truncation_pixel_width = it->pixel_width; + } + else + { + /* We will need the continuation glyph. */ + eassert (it->glyph_row == NULL); + produce_special_glyphs (it, IT_CONTINUATION); + it->continuation_pixel_width = it->pixel_width; + } } /* Reset these values to zero because the produce_special_glyphs -- 2.39.2