I think I have a handle on what is happending...
The modeline redisplay code calls
generate_formatted_string_db
which does
.
.
generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0,
max_pixpos - min_pixpos, findex, type, &offset,
Qnil);
[This calls add_glyph deep inside. Instead of only one element to
the display block it now add all the characters of the string
making it much longer than with the old text-glyph code]
resize_string (XSTRING (result_str), -1,
data.bytepos - XSTRING_LENGTH (result_str));
[Reserve space]
for (elt = 0, len = 0; elt < Dynarr_length (db->runes); elt++)
{
if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
{
len += (set_charptr_emchar
(strdata + len, Dynarr_atp (db->runes,
elt)->object.chr.ch));
}
}
[copies the chars from the display block]
What probably happens is that with the new text glyph code there are
more RUNE_CHAR objects than excpected and we blindely overwrite
wahtever string came after the modeline string...
Sounds plausible?
Jan
P.S. The reason we probably see this with display-time is that the X
first, tty later route causes the full path of the XPM file to
be put in as a really long text glyph.