changeset: 5486:58e320bde005
tag: tip
user: Mike Kupfer <mike.kupfer(a)xemacs.org>
date: Sat Apr 30 13:30:47 2011 +0900
files: src/ChangeLog src/redisplay.c
description:
Handle redisplay edge case.
With motion events when entering a frame and the minibuffer is
active, row and column can be zero, and there aren't any runes.
diff -r 661aba8350af -r 58e320bde005 src/ChangeLog
--- a/src/ChangeLog Sat Apr 30 13:24:10 2011 +0900
+++ b/src/ChangeLog Sat Apr 30 13:30:47 2011 +0900
@@ -1,3 +1,10 @@
+2010-12-31 Mike Kupfer <mike.kupfer(a)xemacs.org>
+
+ * redisplay.c (pixel_to_glyph_translation):
+ Handle redisplay edge case.
+ With motion events when entering a frame and the minibuffer is
+ active, row and column can be zero, and there aren't any runes.
+
2011-04-30 Stephen J. Turnbull <stephen(a)xemacs.org>
* specifier.c (Fspecifier_matching_instance):
diff -r 661aba8350af -r 58e320bde005 src/redisplay.c
--- a/src/redisplay.c Sat Apr 30 13:24:10 2011 +0900
+++ b/src/redisplay.c Sat Apr 30 13:30:47 2011 +0900
@@ -9165,19 +9165,27 @@
for (*col = 0; *col <= Dynarr_length (db->runes); (*col)++)
{
- int past_end = (*col == Dynarr_length (db->runes));
-
- if (!past_end)
- rb = Dynarr_atp (db->runes, *col);
-
- if (past_end ||
- (rb->xpos <= x_coord && x_coord < rb->xpos + rb->width))
- {
- if (past_end)
- {
- (*col)--;
- rb = Dynarr_atp (db->runes, *col);
- }
+ if (*col == Dynarr_length (db->runes))
+ {
+ /* We've run out of runes to look at. Treat the same as
+ the case below where we failed to find a non-glyph
+ character. */
+ if (dl->modeline)
+ *modeline_closest = dl->end_charpos + dl->offset;
+ else
+ *closest = dl->end_charpos + dl->offset;
+
+ if (check_margin_glyphs)
+ get_position_object (dl, obj1, obj2, x_coord,
+ &low_x_coord, &high_x_coord);
+
+ UPDATE_CACHE_RETURN;
+ }
+
+ rb = Dynarr_atp (db->runes, *col);
+
+ if (rb->xpos <= x_coord && x_coord < rb->xpos + rb->width)
+ {
*charpos = rb->charpos + dl->offset;
low_x_coord = rb->xpos;
@@ -9251,9 +9259,8 @@
UPDATE_CACHE_RETURN;
}
- else if (past_end
- || (rb->type == RUNE_CHAR
- && rb->object.chr.ch == '\n'))
+ else if (rb->type == RUNE_CHAR
+ && rb->object.chr.ch == '\n')
{
(*row)--;
/* At this point we may have glyphs in the right
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches