ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.437 by sf-exg, Mon Mar 25 12:28:04 2013 UTC vs.
Revision 1.438 by sf-exg, Mon Mar 25 15:41:07 2013 UTC

2048 int i; /* tmp */ 2048 int i; /* tmp */
2049 rend_t ccol1, /* Cursor colour */ 2049 rend_t ccol1, /* Cursor colour */
2050 ccol2; /* Cursor colour2 */ 2050 ccol2; /* Cursor colour2 */
2051 rend_t cur_rend; 2051 rend_t cur_rend;
2052 int cur_col; 2052 int cur_col;
2053 int cursorwidth;
2053 2054
2054 want_refresh = 0; /* screen is current */ 2055 want_refresh = 0; /* screen is current */
2055 2056
2056 if (refresh_type == NO_REFRESH || !mapped) 2057 if (refresh_type == NO_REFRESH || !mapped)
2057 return; 2058 return;
2095 { 2096 {
2096 int col = screen.cur.col; 2097 int col = screen.cur.col;
2097 2098
2098 while (col && ROW(screen.cur.row).t[col] == NOCHAR) 2099 while (col && ROW(screen.cur.row).t[col] == NOCHAR)
2099 col--; 2100 col--;
2101
2102 cursorwidth = 1;
2103 while (col + cursorwidth < ncol
2104 && ROW(screen.cur.row).t[col + cursorwidth] == NOCHAR)
2105 cursorwidth++;
2100 2106
2101 cur_rend = ROW(screen.cur.row).r[col]; 2107 cur_rend = ROW(screen.cur.row).r[col];
2102 cur_col = col; 2108 cur_col = col;
2103 2109
2104#ifndef NO_CURSORCOLOR 2110#ifndef NO_CURSORCOLOR
2443 else 2449 else
2444 font->draw (*drawable, xpixel, ypixel, text, count, fore, back); 2450 font->draw (*drawable, xpixel, ypixel, text, count, fore, back);
2445 2451
2446 if (ecb_unlikely (rend & RS_Uline && font->descent > 1 && fore != back)) 2452 if (ecb_unlikely (rend & RS_Uline && font->descent > 1 && fore != back))
2447 { 2453 {
2454 if (showcursor && focus && row == screen.cur.row
2455 && IN_RANGE_EXC (col, cur_col, cur_col + cursorwidth))
2456 XSetForeground (dpy, gc, pix_colors[ccol1]);
2457 else
2448#if ENABLE_FRILLS 2458#if ENABLE_FRILLS
2449 if (ISSET_PIXCOLOR (Color_underline)) 2459 if (ISSET_PIXCOLOR (Color_underline))
2450 XSetForeground (dpy, gc, pix_colors[Color_underline]); 2460 XSetForeground (dpy, gc, pix_colors[Color_underline]);
2451 else 2461 else
2452#endif 2462#endif
2466 { 2476 {
2467 if (focus) 2477 if (focus)
2468 scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); 2478 scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend);
2469 else if (oldcursor.row >= 0) 2479 else if (oldcursor.row >= 0)
2470 { 2480 {
2471 int cursorwidth = 1;
2472 int col = oldcursor.col;
2473
2474 while (col && ROW(screen.cur.row).t[col] == NOCHAR)
2475 col--;
2476
2477 while (col + cursorwidth < ncol
2478 && drawn_buf[oldcursor.row].t[col + cursorwidth] == NOCHAR)
2479 cursorwidth++;
2480
2481 XSetForeground (dpy, gc, pix_colors[ccol1]); 2481 XSetForeground (dpy, gc, pix_colors[ccol1]);
2482 2482
2483 XDrawRectangle (dpy, vt, gc, 2483 XDrawRectangle (dpy, vt, gc,
2484 Col2Pixel (col), 2484 Col2Pixel (cur_col),
2485 Row2Pixel (oldcursor.row), 2485 Row2Pixel (oldcursor.row),
2486 (unsigned int) (Width2Pixel (cursorwidth) - 1), 2486 (unsigned int) (Width2Pixel (cursorwidth) - 1),
2487 (unsigned int) (Height2Pixel (1) - 1)); 2487 (unsigned int) (Height2Pixel (1) - 1));
2488 } 2488 }
2489 } 2489 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines