… | |
… | |
681 | } |
681 | } |
682 | else |
682 | else |
683 | scr_blank_screen_mem (l, rstyle); |
683 | scr_blank_screen_mem (l, rstyle); |
684 | } |
684 | } |
685 | |
685 | |
|
|
686 | // move and/or clear selection, if any |
|
|
687 | if (selection.op && current_screen == selection.screen |
|
|
688 | && selection.beg.row <= row2) |
|
|
689 | { |
|
|
690 | selection.beg.row -= count; |
|
|
691 | selection.end.row -= count; |
|
|
692 | selection.mark.row -= count; |
|
|
693 | |
|
|
694 | selection_check (0); |
|
|
695 | } |
|
|
696 | |
686 | // finally move the view window, if desired |
697 | // finally move the view window, if desired |
687 | if (option (Opt_scrollWithBuffer) |
698 | if (option (Opt_scrollWithBuffer) |
688 | && view_start != 0 |
699 | && view_start != 0 |
689 | && view_start != -saveLines) |
700 | && view_start != -saveLines) |
690 | scr_page (UP, count); |
701 | scr_page (UP, count); |
… | |
… | |
692 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
703 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
693 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
704 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
694 | } |
705 | } |
695 | else |
706 | else |
696 | { |
707 | { |
|
|
708 | if (selection.op && current_screen == selection.screen) |
|
|
709 | { |
|
|
710 | if ((selection.beg.row < row1 && selection.end.row > row1) |
|
|
711 | || (selection.beg.row < row2 && selection.end.row > row2) |
|
|
712 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
|
|
713 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
|
|
714 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
|
|
715 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
|
|
716 | { |
|
|
717 | CLEAR_ALL_SELECTION (); |
|
|
718 | selection.op = SELECTION_CLEAR; |
|
|
719 | } |
|
|
720 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
|
|
721 | { |
|
|
722 | /* move selected region too */ |
|
|
723 | selection.beg.row -= count; |
|
|
724 | selection.end.row -= count; |
|
|
725 | selection.mark.row -= count; |
|
|
726 | |
|
|
727 | selection_check (0); |
|
|
728 | } |
|
|
729 | } |
|
|
730 | |
697 | // use a simple and robust scrolling algorithm, this |
731 | // use a simple and robust scrolling algorithm, this |
698 | // part of scr_scroll_text is not time-critical. |
732 | // part of scr_scroll_text is not time-critical. |
699 | |
733 | |
700 | // sever line above scroll region |
734 | // sever line above scroll region |
701 | if (row1) |
735 | if (row1) |
… | |
… | |
728 | l.is_longer (0); |
762 | l.is_longer (0); |
729 | l.touch (); |
763 | l.touch (); |
730 | } |
764 | } |
731 | } |
765 | } |
732 | |
766 | |
733 | // move and/or clear selection, if any |
|
|
734 | if (selection.op && current_screen == selection.screen) |
|
|
735 | { |
|
|
736 | if ((selection.beg.row < row1 && selection.end.row > row1) |
|
|
737 | || (selection.beg.row < row2 && selection.end.row > row2) |
|
|
738 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
|
|
739 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
|
|
740 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
|
|
741 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
|
|
742 | CLEAR_ALL_SELECTION (); |
|
|
743 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
|
|
744 | { |
|
|
745 | /* move selected region too */ |
|
|
746 | selection.beg.row -= count; |
|
|
747 | selection.end.row -= count; |
|
|
748 | selection.mark.row -= count; |
|
|
749 | |
|
|
750 | selection_check (0); |
|
|
751 | } |
|
|
752 | } |
|
|
753 | |
|
|
754 | return count; |
767 | return count; |
755 | } |
768 | } |
756 | |
769 | |
757 | /* ------------------------------------------------------------------------- */ |
770 | /* ------------------------------------------------------------------------- */ |
758 | /* |
771 | /* |
… | |
… | |
762 | rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW |
775 | rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW |
763 | { |
776 | { |
764 | if (len <= 0) /* sanity */ |
777 | if (len <= 0) /* sanity */ |
765 | return; |
778 | return; |
766 | |
779 | |
767 | unsigned char checksel; |
780 | bool checksel; |
768 | unicode_t c; |
781 | unicode_t c; |
769 | int ncol = this->ncol; |
782 | int ncol = this->ncol; |
770 | const wchar_t *strend = str + len; |
783 | const wchar_t *strend = str + len; |
771 | |
784 | |
772 | want_refresh = 1; |
785 | want_refresh = 1; |
… | |
… | |
2029 | * A: set up vars |
2042 | * A: set up vars |
2030 | */ |
2043 | */ |
2031 | refresh_count = 0; |
2044 | refresh_count = 0; |
2032 | |
2045 | |
2033 | unsigned int old_screen_flags = screen.flags; |
2046 | unsigned int old_screen_flags = screen.flags; |
2034 | char have_bg = 0; |
2047 | bool have_bg = 0; |
2035 | #ifdef HAVE_BG_PIXMAP |
2048 | #ifdef HAVE_BG_PIXMAP |
2036 | have_bg = bg_pixmap != None; |
2049 | have_bg = bg_pixmap != None; |
2037 | #endif |
2050 | #endif |
2038 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2051 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2039 | |
2052 | |
… | |
… | |
2045 | HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
2058 | HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
2046 | #if ENABLE_OVERLAY |
2059 | #if ENABLE_OVERLAY |
2047 | scr_swap_overlay (); |
2060 | scr_swap_overlay (); |
2048 | #endif |
2061 | #endif |
2049 | |
2062 | |
2050 | char showcursor = screen.flags & Screen_VisibleCursor; |
2063 | bool showcursor = screen.flags & Screen_VisibleCursor; |
2051 | |
2064 | |
2052 | /* |
2065 | /* |
2053 | * C: set the cursor character (s) |
2066 | * C: set the cursor character (s) |
2054 | */ |
2067 | */ |
2055 | { |
2068 | { |
2056 | unsigned char setoldcursor; |
2069 | bool setoldcursor; |
2057 | |
2070 | |
2058 | #ifdef CURSOR_BLINK |
2071 | #ifdef CURSOR_BLINK |
2059 | if (hidden_cursor) |
2072 | if (hidden_cursor) |
2060 | showcursor = 0; |
2073 | showcursor = 0; |
2061 | #endif |
2074 | #endif |