Subject: bug#28605: 26.0.60; Part of leftmost character hidden

From: martin rudalics <[email-masked]>
Date: Fri, 06 Oct 2017 10:18:55 +0200

> Thinking about this some more, this whole calculation just looks
 > wrong. oldx, oldw, oldw and oldh are in unscaled pixels, as far as I
 > can tell. We need to scale when using GTK routines, but x_clear_area
 > ends up calling X11 routines, so I've almost convinced myself that we
 > should in fact delete the oldw and oldx adjustments for the vertical
 > scrollbar rather than adding them for the horizontal one.

Be sure to distinguish code that decides where to draw a scroll bar from
code that decides which area to clear and possibly redraw.  Sometimes,
the area that gets cleared can be substantially larger than the area
occupied by a toolkit scroll bar.  From my experience, this is often
noticeable with GTK scroll bars since their width is determined by the
chosen theme and cannot be adjusted individually by Emacs.

 > That code was added in commit c0055ff5b03c9121ab5bf752496b09416f0f0a7d
 > which is quite old,

... 2015 rather strikes me as "fairly recent" ...

 > I suspect it did no real harm even though oldx
 > tends to end up negative, possibly x_clear_area does some kind of
 > clipping.

In my experience, X silently swallows anything that happens outside the
frame.  GTK can be much more picky in this regard, especially when
trying to draw something outside a parent widget.  But the corresponding
error messages are usually a pain to read.

martin