Subject: bug#11068: 24.0.94; Face-remapped background does not extend to end of window

From: Eli Zaretskii <[email-masked]>
Date: Sat, 24 Mar 2012 22:47:13 +0200

> Date: Sat, 24 Mar 2012 20:48:13 +0100
> From: martin rudalics <[email-masked]>
> CC: [email-masked], [email-masked], 
>  [email-masked], [email-masked]
> 
>  > I don't know, I would need to see some details, like how will this
>  > preference be visible to the display engine.
> 
> Via some function that extracts a valid face from a window parameter.
> Actually, the only interesting thing IMO is the background attribute.  I
> don't think that changing any other attributes would make sense.

You might be surprised what the users night want ...

> But the same holds for the current patch as well: You simply fill up
> the rest of the window with the background of the remapped default
> face.

No, not only background.  The entire face with all its attributes is
used.  E.g., stipple (which doesn't work on MS-Windows), font
(i.e. the size of each line in pixels), etc.

And you cannot "fill the rest of the window" with some color, at least
not on the device-independent level of the display engine where I made
the changes.  The only way the display engine can dictate colors (and
other face attributes) is by creating glyphs which have these
attributes and adding those glyphs to the current glyph matrix.

What the changes I suggested do is add stretch glyphs of a suitably
computed width to each glyph row that has no text in it.  The changes
are small because the code that does that was already written for the
bidirectional display, which needs to display R2L lines flushed all
the way to the right margin of the window; it does that by prepending
such a stretch glyph to the R2L glyph rows, ahead (i.e to the left) of
the text.  All I needed was to activate that code for the case of
remapped default face, in addition to R2L lines.

>  > Please note that the changes I've shown only notice when the `default'
>  > face is being remapped, they change nothing in how that default face
>  > is computed.  So I suspect we won't be able to use the same mechanism
>  > to do what you want, because what you want changes the way the default
>  > face is computed (IIUC).
> 
> I don't know how face remapping works so I can't tell.  I thought that
> remapping does recompute the default face.

It does, indeed, but I didn't touch that part.  I only used the
already computed remapped face in a couple of places.