Subject: Re: bug#16647: Imprecisions with window-resizing cursors

From: martin rudalics <[email-masked]>
Date: Wed, 26 Feb 2014 11:17:06 +0100

>>    if (window_resize_pixelwise)
 >>      {
 >>        width = height = 1;
 >>        goto virtual_glyph;
 >>      }
 >>
 >> Can you please comment it out and try once more?  In that case setting
 >> `window-resize-pixelwise' to t should not help any more.
 >
 > Not sure if it still matters, but this no longer helps as you've predicted.

In revision 116565 I hopefully fixed the problem with dividers.  The
problem with the vertical border remains and I might not be able to fix
it at all (at least not in a reasonable way).  If you are on X Windows
you can look into it as follows.  At the end of remember_mouse_glyph in
xdisp.c you can find this code:

   /* Visible feedback for debugging.  */
#if 0
#if HAVE_X_WINDOWS
   XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
		  f->output_data.x->normal_gc,
		  gx, gy, width, height);
#endif
#endif

You have to "comment it in" by removing the #if 0 and one #endif,
recompile, and with emacs -Q start moving the mouse.  It will start
filling your frame with rectangles around glyphs.  These are the mouse
glyph rectangles remember_mouse_glyph remembers and you will see them
drawn around your characters.  It might help to increase the default
font to see them better.  These rectangles are important because the
mouse tracking code decides that something "significant" has happened
only when the mouse ends up in another rectangle than the last time.

Now remove the scrollbars, split your frame via C-x 3 and watch the
rectangles fill up around the border between the windows (to redraw the
frame move the border).  You can notice two strange things when the size
of the left window is not an integral multiple of the default font:

(1) The <=> starts to appear only in a rectangle at the left of the
     border.  If that rectangle extends across the border, the <=> will
     continue to appear if you move the mouse to the right crossing the
     border.  As soon as the <=> is on the right of the border, you can't
     start dragging the border.

(2) The shape of the rectangle on the left of the border may vary.  If
     your right fringe is larger than the width for the default font, you
     will usually see a rectangle that is as wide as the fringe when you
     move into the fringe horizontally from the left.  If you move inside
     the fringe up and down (very near to the border but still on the
     left of it) you can observe less wide rectangles.

Confusing, isn't it?  A basic problem is that remember_mouse_glyph
doesn't know anything about windows or vertical borders.  It treats the
frame as one huge area and I haven't been able yet to clip mouse glyph
rectangles at window borders.  If anyone knows how to do that - and it
should be certainly doable and done, please tell me.  I'm too silly to
understand that because the value calculate for "gx + width" here always
remains less than the window's pixel width.

And if you set `window-resize-pixelwise' to t, you will immediately
notice that the rectangles reduce to single pixels.  So there are no
rectangles overlapping with window borders and the problem disappears
just as you discovered recently.

martin