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.446 by root, Thu May 22 18:54:33 2014 UTC vs.
Revision 1.455 by sf-exg, Wed Sep 30 12:57:04 2015 UTC

1011 } 1011 }
1012 else if (screen.cur.row > 0 1012 else if (screen.cur.row > 0
1013 && ROW(screen.cur.row - 1).is_longer ()) 1013 && ROW(screen.cur.row - 1).is_longer ())
1014 { 1014 {
1015 linep = &ROW(screen.cur.row - 1); 1015 linep = &ROW(screen.cur.row - 1);
1016 tp = line->t + ncol - 1; 1016 tp = linep->t + ncol - 1;
1017 rp = line->r + ncol - 1; 1017 rp = linep->r + ncol - 1;
1018 } 1018 }
1019 else 1019 else
1020 continue; 1020 continue;
1021 1021
1022 linep->touch (); 1022 linep->touch ();
2118 ccol2 = bgcolor_of (rstyle); 2118 ccol2 = bgcolor_of (rstyle);
2119#else 2119#else
2120 ccol2 = Color_bg; 2120 ccol2 = Color_bg;
2121#endif 2121#endif
2122 2122
2123 if (focus) 2123 if (focus && cursor_type == 0)
2124 { 2124 {
2125 rend_t rend = cur_rend; 2125 rend_t rend = cur_rend;
2126 2126
2127 if (option (Opt_cursorUnderline))
2128 rend ^= RS_Uline;
2129 else
2130 {
2131 rend ^= RS_RVid; 2127 rend ^= RS_RVid;
2132 rend = SET_FGCOLOR (rend, ccol1); 2128 rend = SET_FGCOLOR (rend, ccol1);
2133 rend = SET_BGCOLOR (rend, ccol2); 2129 rend = SET_BGCOLOR (rend, ccol2);
2134 }
2135 2130
2136 scr_set_char_rend (ROW(screen.cur.row), cur_col, rend); 2131 scr_set_char_rend (ROW(screen.cur.row), cur_col, rend);
2137 } 2132 }
2138 } 2133 }
2139 2134
2140 /* make sure no outline cursor is left around */ 2135 /* make sure no outline cursor is left around */
2141 if (ocrow != -1) 2136 if (ocrow != -1 && ocrow < nrow && oldcursor.col < ncol)
2142 {
2143 if (screen.cur.row - view_start != ocrow
2144 || screen.cur.col != oldcursor.col)
2145 {
2146 if (ocrow < nrow
2147 && oldcursor.col < ncol)
2148 drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); 2137 drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline);
2149 }
2150 }
2151 2138
2152 // save the current cursor coordinates if the cursor is visible 2139 // save the current cursor coordinates if the cursor is visible
2153 // and the window is unfocused, so as to clear the outline cursor 2140 // and either the window is unfocused or the cursor style is
2141 // underline or vertical bar, so as to clear the outline cursor in
2154 // in the next refresh if the cursor moves 2142 // the next refresh if the cursor moves or becomes invisible
2155 if (showcursor && !focus && screen.cur.row - view_start < nrow) 2143 if (showcursor && (!focus || cursor_type != 0) && screen.cur.row - view_start < nrow)
2156 { 2144 {
2157 oldcursor.row = screen.cur.row - view_start; 2145 oldcursor.row = screen.cur.row - view_start;
2158 oldcursor.col = screen.cur.col; 2146 oldcursor.col = screen.cur.col;
2159 } 2147 }
2160 else 2148 else
2247 int ypixel = (int)Row2Pixel (row); 2235 int ypixel = (int)Row2Pixel (row);
2248 2236
2249 for (col = 0; col < ncol; col++) 2237 for (col = 0; col < ncol; col++)
2250 { 2238 {
2251 /* compare new text with old - if exactly the same then continue */ 2239 /* compare new text with old - if exactly the same then continue */
2252 if (stp[col] == dtp[col] /* Must match characters to skip. */ 2240 if (stp[col] == dtp[col] && RS_SAME (srp[col], drp[col]))
2253 && (RS_SAME (srp[col], drp[col]) /* Either rendition the same or */
2254 || (stp[col] == ' ' /* space w/ no background change */
2255 && GET_BGATTR (srp[col]) == GET_BGATTR (drp[col]))))
2256 continue; 2241 continue;
2257 2242
2258 // redraw one or more characters 2243 // redraw one or more characters
2259 2244
2260 // seek to the beginning of wide characters 2245 // seek to the beginning of wide characters
2456 * G: cleanup cursor and display outline cursor if necessary 2441 * G: cleanup cursor and display outline cursor if necessary
2457 */ 2442 */
2458 if (showcursor) 2443 if (showcursor)
2459 { 2444 {
2460 if (focus) 2445 if (focus)
2446 {
2447 if (cursor_type == 0)
2461 scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); 2448 scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend);
2449 else if (oldcursor.row >= 0)
2450 {
2451 XSetForeground (dpy, gc, pix_colors[ccol1]);
2452 if (cursor_type == 1)
2453 XFillRectangle (dpy, vt, gc,
2454 Col2Pixel (cur_col),
2455 Row2Pixel (oldcursor.row + 1) - 2,
2456 Width2Pixel (1),
2457 2);
2458 else
2459 XFillRectangle (dpy, vt, gc,
2460 Col2Pixel (cur_col),
2461 Row2Pixel (oldcursor.row),
2462 2,
2463 Height2Pixel (1));
2464 }
2465 }
2462 else if (oldcursor.row >= 0) 2466 else if (oldcursor.row >= 0)
2463 { 2467 {
2464 XSetForeground (dpy, gc, pix_colors[ccol1]); 2468 XSetForeground (dpy, gc, pix_colors[ccol1]);
2465 2469
2466 XDrawRectangle (dpy, vt, gc, 2470 XDrawRectangle (dpy, vt, gc,
2510 scr_remap_chars (swap_buf [i]); 2514 scr_remap_chars (swap_buf [i]);
2511 } 2515 }
2512} 2516}
2513 2517
2514void ecb_cold 2518void ecb_cold
2515rxvt_term::scr_recolour (bool refresh) NOTHROW 2519rxvt_term::scr_recolor (bool refresh) NOTHROW
2516{ 2520{
2517 bool transparent = false; 2521 bool transparent = false;
2518 2522
2519#ifdef HAVE_IMG 2523#ifdef HAVE_IMG
2520 if (bg_img != 0) 2524 if (bg_img != 0)
2541 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); 2545 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
2542 } 2546 }
2543 2547
2544 XClearWindow (dpy, parent); 2548 XClearWindow (dpy, parent);
2545 2549
2546 if (scrollBar.win) 2550 if (scrollBar.state && scrollBar.win)
2547 { 2551 {
2548 if (transparent) 2552 if (transparent)
2549 XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); 2553 XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative);
2550 else 2554 else
2551 XSetWindowBackground (dpy, scrollBar.win, pix_colors[scrollBar.color ()]); 2555 XSetWindowBackground (dpy, scrollBar.win, pix_colors[scrollBar.color ()]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines