comparison src/xterm.c @ 58403:c936fa56eb60

(x_clip_to_row): Add area arg. Callers changed. (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
author Kim F. Storm <storm@cua.dk>
date Sun, 21 Nov 2004 15:49:12 +0000
parents 95edcd1fae73
children 75cac0943699 2a3f27a45698 f2ebccfa87d4
comparison
equal deleted inserted replaced
58402:d1d4d5846215 58403:c936fa56eb60
355 static void x_frame_rehighlight P_ ((struct x_display_info *)); 355 static void x_frame_rehighlight P_ ((struct x_display_info *));
356 static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); 356 static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
357 static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, 357 static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
358 enum text_cursor_kinds)); 358 enum text_cursor_kinds));
359 359
360 static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC)); 360 static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC));
361 static void x_flush P_ ((struct frame *f)); 361 static void x_flush P_ ((struct frame *f));
362 static void x_update_begin P_ ((struct frame *)); 362 static void x_update_begin P_ ((struct frame *));
363 static void x_update_window_begin P_ ((struct window *)); 363 static void x_update_window_begin P_ ((struct window *));
364 static void x_after_update_window_line P_ ((struct glyph_row *)); 364 static void x_after_update_window_line P_ ((struct glyph_row *));
365 static struct scroll_bar *x_window_to_scroll_bar P_ ((Display *, Window)); 365 static struct scroll_bar *x_window_to_scroll_bar P_ ((Display *, Window));
707 visible last row. */ 707 visible last row. */
708 int oldY = row->y; 708 int oldY = row->y;
709 int oldVH = row->visible_height; 709 int oldVH = row->visible_height;
710 row->visible_height = p->h; 710 row->visible_height = p->h;
711 row->y -= rowY - p->y; 711 row->y -= rowY - p->y;
712 x_clip_to_row (w, row, gc); 712 x_clip_to_row (w, row, -1, gc);
713 row->y = oldY; 713 row->y = oldY;
714 row->visible_height = oldVH; 714 row->visible_height = oldVH;
715 } 715 }
716 else 716 else
717 x_clip_to_row (w, row, gc); 717 x_clip_to_row (w, row, -1, gc);
718 718
719 if (p->bx >= 0 && !p->overlay_p) 719 if (p->bx >= 0 && !p->overlay_p)
720 { 720 {
721 /* In case the same realized face is used for fringes and 721 /* In case the same realized face is used for fringes and
722 for something displayed in the text (e.g. face `region' on 722 for something displayed in the text (e.g. face `region' on
7133 ROW may be a text row or, e.g., a mode line. Text rows must be 7133 ROW may be a text row or, e.g., a mode line. Text rows must be
7134 clipped to the interior of the window dedicated to text display, 7134 clipped to the interior of the window dedicated to text display,
7135 mode lines must be clipped to the whole window. */ 7135 mode lines must be clipped to the whole window. */
7136 7136
7137 static void 7137 static void
7138 x_clip_to_row (w, row, gc) 7138 x_clip_to_row (w, row, area, gc)
7139 struct window *w; 7139 struct window *w;
7140 struct glyph_row *row; 7140 struct glyph_row *row;
7141 int area;
7141 GC gc; 7142 GC gc;
7142 { 7143 {
7143 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7144 struct frame *f = XFRAME (WINDOW_FRAME (w));
7144 XRectangle clip_rect; 7145 XRectangle clip_rect;
7145 int window_y, window_width; 7146 int window_x, window_y, window_width;
7146 7147
7147 window_box (w, -1, 0, &window_y, &window_width, 0); 7148 window_box (w, area, &window_x, &window_y, &window_width, 0);
7148 7149
7149 clip_rect.x = WINDOW_TO_FRAME_PIXEL_X (w, 0); 7150 clip_rect.x = window_x;
7150 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); 7151 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
7151 clip_rect.y = max (clip_rect.y, window_y); 7152 clip_rect.y = max (clip_rect.y, window_y);
7152 clip_rect.width = window_width; 7153 clip_rect.width = window_width;
7153 clip_rect.height = row->visible_height; 7154 clip_rect.height = row->visible_height;
7154 7155
7210 dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_X_WINDOW (f), 7211 dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_X_WINDOW (f),
7211 GCForeground, &xgcv); 7212 GCForeground, &xgcv);
7212 gc = dpyinfo->scratch_cursor_gc; 7213 gc = dpyinfo->scratch_cursor_gc;
7213 7214
7214 /* Set clipping, draw the rectangle, and reset clipping again. */ 7215 /* Set clipping, draw the rectangle, and reset clipping again. */
7215 x_clip_to_row (w, row, gc); 7216 x_clip_to_row (w, row, TEXT_AREA, gc);
7216 XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h); 7217 XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h);
7217 XSetClipMask (dpy, gc, None); 7218 XSetClipMask (dpy, gc, None);
7218 } 7219 }
7219 7220
7220 7221
7282 if (width < 0) 7283 if (width < 0)
7283 width = FRAME_CURSOR_WIDTH (f); 7284 width = FRAME_CURSOR_WIDTH (f);
7284 width = min (cursor_glyph->pixel_width, width); 7285 width = min (cursor_glyph->pixel_width, width);
7285 7286
7286 w->phys_cursor_width = width; 7287 w->phys_cursor_width = width;
7287 x_clip_to_row (w, row, gc); 7288 x_clip_to_row (w, row, TEXT_AREA, gc);
7288 7289
7289 if (kind == BAR_CURSOR) 7290 if (kind == BAR_CURSOR)
7290 XFillRectangle (dpy, window, gc, 7291 XFillRectangle (dpy, window, gc,
7291 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), 7292 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
7292 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), 7293 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),