… | |
… | |
715 | |
715 | |
716 | // finally move the view window, if desired |
716 | // finally move the view window, if desired |
717 | if (option (Opt_scrollWithBuffer) |
717 | if (option (Opt_scrollWithBuffer) |
718 | && view_start != 0 |
718 | && view_start != 0 |
719 | && view_start != -saveLines) |
719 | && view_start != -saveLines) |
720 | scr_page (UP, count); |
720 | scr_page (count); |
721 | |
721 | |
722 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
722 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
723 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
723 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
724 | } |
724 | } |
725 | else |
725 | else |
… | |
… | |
1910 | /* |
1910 | /* |
1911 | * Page the screen up/down nlines |
1911 | * Page the screen up/down nlines |
1912 | * direction should be UP or DN |
1912 | * direction should be UP or DN |
1913 | */ |
1913 | */ |
1914 | bool |
1914 | bool |
1915 | rxvt_term::scr_page (enum page_dirn direction, int nlines) NOTHROW |
1915 | rxvt_term::scr_page (int nlines) NOTHROW |
1916 | { |
1916 | { |
1917 | int new_view_start = |
|
|
1918 | direction == UP ? view_start - nlines |
|
|
1919 | : view_start + nlines; |
|
|
1920 | |
|
|
1921 | return scr_changeview (new_view_start); |
1917 | return scr_changeview (view_start - nlines); |
1922 | } |
1918 | } |
1923 | |
1919 | |
1924 | bool |
1920 | bool |
1925 | rxvt_term::scr_changeview (int new_view_start) NOTHROW |
1921 | rxvt_term::scr_changeview (int new_view_start) NOTHROW |
1926 | { |
1922 | { |
… | |
… | |
2048 | int i; /* tmp */ |
2044 | int i; /* tmp */ |
2049 | rend_t ccol1, /* Cursor colour */ |
2045 | rend_t ccol1, /* Cursor colour */ |
2050 | ccol2; /* Cursor colour2 */ |
2046 | ccol2; /* Cursor colour2 */ |
2051 | rend_t cur_rend; |
2047 | rend_t cur_rend; |
2052 | int cur_col; |
2048 | int cur_col; |
|
|
2049 | int cursorwidth; |
2053 | |
2050 | |
2054 | want_refresh = 0; /* screen is current */ |
2051 | want_refresh = 0; /* screen is current */ |
2055 | |
2052 | |
2056 | if (refresh_type == NO_REFRESH || !mapped) |
2053 | if (refresh_type == NO_REFRESH || !mapped) |
2057 | return; |
2054 | return; |
… | |
… | |
2082 | |
2079 | |
2083 | /* |
2080 | /* |
2084 | * C: set the cursor character (s) |
2081 | * C: set the cursor character (s) |
2085 | */ |
2082 | */ |
2086 | { |
2083 | { |
2087 | bool setoldcursor; |
|
|
2088 | |
|
|
2089 | #ifdef CURSOR_BLINK |
2084 | #ifdef CURSOR_BLINK |
2090 | if (hidden_cursor) |
2085 | if (hidden_cursor) |
2091 | showcursor = 0; |
2086 | showcursor = 0; |
2092 | #endif |
2087 | #endif |
2093 | |
2088 | |
… | |
… | |
2095 | { |
2090 | { |
2096 | int col = screen.cur.col; |
2091 | int col = screen.cur.col; |
2097 | |
2092 | |
2098 | while (col && ROW(screen.cur.row).t[col] == NOCHAR) |
2093 | while (col && ROW(screen.cur.row).t[col] == NOCHAR) |
2099 | col--; |
2094 | col--; |
|
|
2095 | |
|
|
2096 | cursorwidth = 1; |
|
|
2097 | while (col + cursorwidth < ncol |
|
|
2098 | && ROW(screen.cur.row).t[col + cursorwidth] == NOCHAR) |
|
|
2099 | cursorwidth++; |
2100 | |
2100 | |
2101 | cur_rend = ROW(screen.cur.row).r[col]; |
2101 | cur_rend = ROW(screen.cur.row).r[col]; |
2102 | cur_col = col; |
2102 | cur_col = col; |
2103 | |
2103 | |
2104 | #ifndef NO_CURSORCOLOR |
2104 | #ifndef NO_CURSORCOLOR |
… | |
… | |
2139 | scr_set_char_rend (ROW(screen.cur.row), cur_col, rend); |
2139 | scr_set_char_rend (ROW(screen.cur.row), cur_col, rend); |
2140 | } |
2140 | } |
2141 | } |
2141 | } |
2142 | |
2142 | |
2143 | /* make sure no outline cursor is left around */ |
2143 | /* make sure no outline cursor is left around */ |
2144 | setoldcursor = 0; |
|
|
2145 | if (ocrow != -1) |
2144 | if (ocrow != -1) |
2146 | { |
2145 | { |
2147 | if (screen.cur.row - view_start != ocrow |
2146 | if (screen.cur.row - view_start != ocrow |
2148 | || screen.cur.col != oldcursor.col) |
2147 | || screen.cur.col != oldcursor.col) |
2149 | { |
2148 | { |
2150 | if (ocrow < nrow |
2149 | if (ocrow < nrow |
2151 | && oldcursor.col < ncol) |
2150 | && oldcursor.col < ncol) |
2152 | drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); |
2151 | drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); |
2153 | |
|
|
2154 | if (focus || !showcursor) |
|
|
2155 | oldcursor.row = -1; |
|
|
2156 | else |
|
|
2157 | setoldcursor = 1; |
|
|
2158 | } |
2152 | } |
2159 | } |
2153 | } |
2160 | else if (!focus) |
|
|
2161 | setoldcursor = 1; |
|
|
2162 | |
2154 | |
2163 | if (setoldcursor) |
2155 | // save the current cursor coordinates if the cursor is visible |
|
|
2156 | // and the window is unfocused, so as to clear the outline cursor |
|
|
2157 | // in the next refresh if the cursor moves |
|
|
2158 | if (showcursor && !focus && screen.cur.row - view_start < nrow) |
2164 | { |
2159 | { |
2165 | if (screen.cur.row - view_start >= nrow) |
|
|
2166 | oldcursor.row = -1; |
|
|
2167 | else |
|
|
2168 | { |
|
|
2169 | oldcursor.row = screen.cur.row - view_start; |
2160 | oldcursor.row = screen.cur.row - view_start; |
2170 | oldcursor.col = screen.cur.col; |
2161 | oldcursor.col = screen.cur.col; |
2171 | } |
|
|
2172 | } |
2162 | } |
|
|
2163 | else |
|
|
2164 | oldcursor.row = -1; |
2173 | } |
2165 | } |
2174 | |
2166 | |
2175 | #ifndef NO_SLOW_LINK_SUPPORT |
2167 | #ifndef NO_SLOW_LINK_SUPPORT |
2176 | /* |
2168 | /* |
2177 | * D: CopyArea pass - very useful for slower links |
2169 | * D: CopyArea pass - very useful for slower links |
… | |
… | |
2443 | else |
2435 | else |
2444 | font->draw (*drawable, xpixel, ypixel, text, count, fore, back); |
2436 | font->draw (*drawable, xpixel, ypixel, text, count, fore, back); |
2445 | |
2437 | |
2446 | if (ecb_unlikely (rend & RS_Uline && font->descent > 1 && fore != back)) |
2438 | if (ecb_unlikely (rend & RS_Uline && font->descent > 1 && fore != back)) |
2447 | { |
2439 | { |
|
|
2440 | if (showcursor && focus && row == screen.cur.row |
|
|
2441 | && IN_RANGE_EXC (col, cur_col, cur_col + cursorwidth)) |
|
|
2442 | XSetForeground (dpy, gc, pix_colors[ccol1]); |
|
|
2443 | else |
2448 | #if ENABLE_FRILLS |
2444 | #if ENABLE_FRILLS |
2449 | if (ISSET_PIXCOLOR (Color_underline)) |
2445 | if (ISSET_PIXCOLOR (Color_underline)) |
2450 | XSetForeground (dpy, gc, pix_colors[Color_underline]); |
2446 | XSetForeground (dpy, gc, pix_colors[Color_underline]); |
2451 | else |
2447 | else |
2452 | #endif |
2448 | #endif |
… | |
… | |
2466 | { |
2462 | { |
2467 | if (focus) |
2463 | if (focus) |
2468 | scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); |
2464 | scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); |
2469 | else if (oldcursor.row >= 0) |
2465 | else if (oldcursor.row >= 0) |
2470 | { |
2466 | { |
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]); |
2467 | XSetForeground (dpy, gc, pix_colors[ccol1]); |
2482 | |
2468 | |
2483 | XDrawRectangle (dpy, vt, gc, |
2469 | XDrawRectangle (dpy, vt, gc, |
2484 | Col2Pixel (col), |
2470 | Col2Pixel (cur_col), |
2485 | Row2Pixel (oldcursor.row), |
2471 | Row2Pixel (oldcursor.row), |
2486 | (unsigned int) (Width2Pixel (cursorwidth) - 1), |
2472 | (unsigned int) (Width2Pixel (cursorwidth) - 1), |
2487 | (unsigned int) (Height2Pixel (1) - 1)); |
2473 | (unsigned int) (Height2Pixel (1) - 1)); |
2488 | } |
2474 | } |
2489 | } |
2475 | } |