[gnu.emacs.bug] display bug

Duchier-Denys@cs.yale.edu (Denys Duchier) (01/17/90)

I was hacking epoch to handle motion events, and I noticed that I was
getting quite a bit of cursor flickering when the point was in a non
left most window. After puzzling over this for a long time, I found
that `this_line_bufpos' was always 0 when the point was in such a
window, thus disabling certain optimizations (in particular, not to do
anything when nothing happened). I think I found the culprit:

in file "xdisp.c" function `display_text_line':

	  if (hpos == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0)
	      && val.vpos)
	    {
	      this_line_bufpos = start;
	      this_line_buffer = bf_cur;
	      this_line_vpos = point_vpos;
	      this_line_start_hpos = hpos;
	      this_line_endpos = bf_s1 + bf_s2 + 1 - lastpos;
	    }
	  else
	    this_line_bufpos = 0;

this will always fail when the w->left != 0 (I think). I `fixed' it as
follows:
	  if ((hpos - XFASTINT (w->left)) == (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0)
	      && val.vpos)
	    {
	      this_line_bufpos = start;
	      this_line_buffer = bf_cur;
	      this_line_vpos = point_vpos;
	      this_line_start_hpos = hpos;
	      this_line_endpos = bf_s1 + bf_s2 + 1 - lastpos;
	    }
	  else
	    this_line_bufpos = 0;

was this a real bug? is this a real fix? anybody knows? it seems to
work, but the display code is rather hard to understand, so I'm really
not sure. I still get flickering when the same buffer appears in
several windows, but that's probably a different problem.

--Denys