redraw anything on its account. */
static int mouse_face_beg_row, mouse_face_beg_col;
static int mouse_face_end_row, mouse_face_end_col;
+static int mouse_face_past_end;
static Lisp_Object mouse_face_window;
static int mouse_face_face_id;
&& row >= mouse_face_beg_row
&& row <= mouse_face_end_row
&& (row > mouse_face_beg_row || column >= mouse_face_beg_col)
- && (row < mouse_face_end_row || column < mouse_face_end_col)))
+ && (row < mouse_face_end_row || column < mouse_face_end_col
+ || mouse_face_past_end)))
{
Lisp_Object mouse_face, overlay, position;
Lisp_Object *overlay_vec;
before = Foverlay_start (overlay);
after = Foverlay_end (overlay);
/* Record this as the current active region. */
- fast_find_position (window, before,
- &mouse_face_beg_col, &mouse_face_beg_row);
- fast_find_position (window, after,
- &mouse_face_end_col, &mouse_face_end_row);
+ fast_find_position (window, before, &mouse_face_beg_col,
+ &mouse_face_beg_row);
+ mouse_face_past_end
+ = !fast_find_position (window, after, &mouse_face_end_col,
+ &mouse_face_end_row);
mouse_face_window = window;
mouse_face_face_id = compute_char_face (f, w, pos, 0, 0,
&ignore, pos + 1, 1);
= Fnext_single_property_change (position, Qmouse_face,
w->buffer, end);
/* Record this as the current active region. */
- fast_find_position (window, before,
- &mouse_face_beg_col, &mouse_face_beg_row);
- fast_find_position (window, after,
- &mouse_face_end_col, &mouse_face_end_row);
+ fast_find_position (window, before, &mouse_face_beg_col,
+ &mouse_face_beg_row);
+ mouse_face_past_end
+ = !fast_find_position (window, after, &mouse_face_end_col,
+ &mouse_face_end_row);
mouse_face_window = window;
mouse_face_face_id
= compute_char_face (f, w, pos, 0, 0,
This assumes display in WINDOW is up to date.
If POS is above start of WINDOW, return coords
of start of first screen line.
- If POS is after end of WINDOW, return coords of end of last screen line. */
+ If POS is after end of WINDOW, return coords of end of last screen line.
+
+ Value is 1 if POS is in range, 0 if it was off screen. */
static int
fast_find_position (window, pos, columnp, rowp)
struct window *w = XWINDOW (window);
FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
int i;
- int row;
+ int row = 0;
int left = w->left;
int top = w->top;
int height = XFASTINT (w->height) - ! MINI_WINDOW_P (w);
int *charstarts;
int lastcol;
+ /* Find the right row. */
for (i = 0;
i < height;
i++)
row = i;
}
+ /* Find the right column with in it. */
charstarts = FRAME_CURRENT_GLYPHS (f)->charstarts[top + row];
lastcol = left;
for (i = 0; i < width; i++)
return 1;
}
else if (charstarts[left + i] > pos)
+ break;
+ else if (charstarts[left + i] > 0)
lastcol = left + i;
}
PIXEL_WIDTH (f) = pixelwidth;
PIXEL_HEIGHT (f) = pixelheight;
+ /* If cursor was outside the new size, mark it as off. */
+ if (f->phys_cursor_y >= rows
+ || f->phys_cursor_x >= cols)
+ {
+ f->phys_cursor_x = -1;
+ f->phys_cursor_y = -1;
+ }
+
/* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
receive in the ConfigureNotify event; if we get what we asked
for, then the event won't cause the screen to become garbaged, so