… | |
… | |
46 | |
46 | |
47 | /* ------------------------------------------------------------------------- * |
47 | /* ------------------------------------------------------------------------- * |
48 | * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * |
48 | * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * |
49 | * ------------------------------------------------------------------------- */ |
49 | * ------------------------------------------------------------------------- */ |
50 | #define ZERO_SCROLLBACK() \ |
50 | #define ZERO_SCROLLBACK() \ |
51 | if (options & Opt_scrollTtyOutput) \ |
51 | if (OPTION (Opt_scrollTtyOutput)) \ |
52 | view_start = 0 |
52 | view_start = 0 |
53 | #define CLEAR_SELECTION() \ |
53 | #define CLEAR_SELECTION() \ |
54 | selection.beg.row = selection.beg.col \ |
54 | selection.beg.row = selection.beg.col \ |
55 | = selection.end.row = selection.end.col = 0 |
55 | = selection.end.row = selection.end.col = 0 |
56 | #define CLEAR_ALL_SELECTION() \ |
56 | #define CLEAR_ALL_SELECTION() \ |
… | |
… | |
530 | |
530 | |
531 | screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1); |
531 | screen.cur.row = clamp (screen.cur.row, 0, prev_nrow - 1); |
532 | screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1); |
532 | screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1); |
533 | |
533 | |
534 | #if NSCREENS |
534 | #if NSCREENS |
535 | if (options & Opt_secondaryScreen) |
535 | if (OPTION (Opt_secondaryScreen)) |
536 | { |
536 | { |
537 | num_scr = 0; |
537 | num_scr = 0; |
538 | |
538 | |
539 | for (int i = prev_nrow; i--; ) |
539 | for (int i = prev_nrow; i--; ) |
540 | ::swap (ROW(i), swap_buf [i]); |
540 | ::swap (ROW(i), swap_buf [i]); |
… | |
… | |
544 | screen.flags |= Screen_VisibleCursor; |
544 | screen.flags |= Screen_VisibleCursor; |
545 | swap.flags |= Screen_VisibleCursor; |
545 | swap.flags |= Screen_VisibleCursor; |
546 | } |
546 | } |
547 | else |
547 | else |
548 | #endif |
548 | #endif |
549 | if (options & Opt_secondaryScroll) |
549 | if (OPTION (Opt_secondaryScroll)) |
550 | scr_scroll_text (0, prev_nrow - 1, prev_nrow); |
550 | scr_scroll_text (0, prev_nrow - 1, prev_nrow); |
551 | |
551 | |
552 | return scrn; |
552 | return scrn; |
553 | } |
553 | } |
554 | |
554 | |
… | |
… | |
616 | num_scr += count; |
616 | num_scr += count; |
617 | |
617 | |
618 | if (count > 0 |
618 | if (count > 0 |
619 | && row1 == 0 |
619 | && row1 == 0 |
620 | && row2 == nrow - 1 |
620 | && row2 == nrow - 1 |
621 | && (current_screen == PRIMARY || options & Opt_secondaryScroll)) |
621 | && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll))) |
622 | { |
622 | { |
623 | nsaved = min (nsaved + count, saveLines); |
623 | nsaved = min (nsaved + count, saveLines); |
624 | term_start = (term_start + count) % total_rows; |
624 | term_start = (term_start + count) % total_rows; |
625 | |
625 | |
626 | if (selection.op && current_screen == selection.screen) |
626 | if (selection.op && current_screen == selection.screen) |
… | |
… | |
642 | { |
642 | { |
643 | ROW(row2 - i).l = 0; |
643 | ROW(row2 - i).l = 0; |
644 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
644 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
645 | } |
645 | } |
646 | |
646 | |
647 | if ((options & Opt_scrollWithBuffer) |
647 | if (OPTION (Opt_scrollWithBuffer) |
648 | && view_start != 0 |
648 | && view_start != 0 |
649 | && view_start != saveLines) |
649 | && view_start != saveLines) |
650 | scr_page (UP, count); |
650 | scr_page (UP, count); |
651 | } |
651 | } |
652 | else |
652 | else |
… | |
… | |
1018 | if (count) |
1018 | if (count) |
1019 | x = ncol - 1; |
1019 | x = ncol - 1; |
1020 | |
1020 | |
1021 | // store horizontal tab commands as characters inside the text |
1021 | // store horizontal tab commands as characters inside the text |
1022 | // buffer so they can be selected and pasted. |
1022 | // buffer so they can be selected and pasted. |
1023 | if (ht && options & Opt_pastableTabs) |
1023 | if (ht && OPTION (Opt_pastableTabs)) |
1024 | { |
1024 | { |
1025 | base_rend = SET_FONT (base_rend, 0); |
1025 | base_rend = SET_FONT (base_rend, 0); |
1026 | |
1026 | |
1027 | if (!l.is_longer ()) /* XXX: think about this */ |
1027 | if (!l.is_longer ()) /* XXX: think about this */ |
1028 | max_it (l.l, x); |
1028 | max_it (l.l, x); |
… | |
… | |
1593 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1593 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1594 | #if XPM_BACKGROUND |
1594 | #if XPM_BACKGROUND |
1595 | if (bgPixmap.pixmap == None) |
1595 | if (bgPixmap.pixmap == None) |
1596 | #endif |
1596 | #endif |
1597 | #if TRANSPARENT |
1597 | #if TRANSPARENT |
1598 | if (! (options & Opt_transparent) || am_transparent == 0) |
1598 | if (! OPTION (Opt_transparent) || am_transparent == 0) |
1599 | #endif |
1599 | #endif |
1600 | XSetWindowBackground (display->display, vt, |
1600 | XSetWindowBackground (display->display, vt, |
1601 | pix_colors[Color_bg]); |
1601 | pix_colors[Color_bg]); |
1602 | |
1602 | |
1603 | gcvalue.foreground = pix_colors[Color_fg]; |
1603 | gcvalue.foreground = pix_colors[Color_fg]; |
… | |
… | |
1836 | { |
1836 | { |
1837 | #ifndef NO_BELL |
1837 | #ifndef NO_BELL |
1838 | |
1838 | |
1839 | # ifndef NO_MAPALERT |
1839 | # ifndef NO_MAPALERT |
1840 | # ifdef MAPALERT_OPTION |
1840 | # ifdef MAPALERT_OPTION |
1841 | if (options & Opt_mapAlert) |
1841 | if (OPTION (Opt_mapAlert)) |
1842 | # endif |
1842 | # endif |
1843 | XMapWindow (display->display, parent[0]); |
1843 | XMapWindow (display->display, parent[0]); |
1844 | # endif |
1844 | # endif |
1845 | |
1845 | |
1846 | if (options & Opt_visualBell) |
1846 | if (OPTION (Opt_visualBell)) |
1847 | { |
1847 | { |
1848 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1848 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1849 | rxvt_usleep (VISUAL_BELL_DURATION); |
1849 | rxvt_usleep (VISUAL_BELL_DURATION); |
1850 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1850 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1851 | } |
1851 | } |
… | |
… | |
1942 | |
1942 | |
1943 | #if XPM_BACKGROUND |
1943 | #if XPM_BACKGROUND |
1944 | must_clear |= bgPixmap.pixmap != None; |
1944 | must_clear |= bgPixmap.pixmap != None; |
1945 | #endif |
1945 | #endif |
1946 | #if TRANSPARENT |
1946 | #if TRANSPARENT |
1947 | must_clear |= (options & Opt_transparent) && am_transparent; |
1947 | must_clear |= OPTION (Opt_transparent) && am_transparent; |
1948 | #endif |
1948 | #endif |
1949 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
1949 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
1950 | |
1950 | |
1951 | /* |
1951 | /* |
1952 | * B: reverse any characters which are selected |
1952 | * B: reverse any characters which are selected |
… | |
… | |
1976 | |
1976 | |
1977 | crp = &ROW(screen.cur.row).r[col]; |
1977 | crp = &ROW(screen.cur.row).r[col]; |
1978 | |
1978 | |
1979 | if (showcursor && focus) |
1979 | if (showcursor && focus) |
1980 | { |
1980 | { |
1981 | if (options & Opt_cursorUnderline) |
1981 | if (OPTION (Opt_cursorUnderline)) |
1982 | *crp ^= RS_Uline; |
1982 | *crp ^= RS_Uline; |
1983 | else |
1983 | else |
1984 | { |
1984 | { |
1985 | *crp ^= RS_RVid; |
1985 | *crp ^= RS_RVid; |
1986 | |
1986 | |
… | |
… | |
2319 | */ |
2319 | */ |
2320 | if (showcursor) |
2320 | if (showcursor) |
2321 | { |
2321 | { |
2322 | if (focus) |
2322 | if (focus) |
2323 | { |
2323 | { |
2324 | if (options & Opt_cursorUnderline) |
2324 | if (OPTION (Opt_cursorUnderline)) |
2325 | *crp ^= RS_Uline; |
2325 | *crp ^= RS_Uline; |
2326 | else |
2326 | else |
2327 | { |
2327 | { |
2328 | *crp ^= RS_RVid; |
2328 | *crp ^= RS_RVid; |
2329 | #ifndef NO_CURSORCOLOR |
2329 | #ifndef NO_CURSORCOLOR |
… | |
… | |
3301 | selection_delimit_word (DN, &selection.end, &selection.end); |
3301 | selection_delimit_word (DN, &selection.end, &selection.end); |
3302 | } |
3302 | } |
3303 | else if (selection.clicks == 3) |
3303 | else if (selection.clicks == 3) |
3304 | { |
3304 | { |
3305 | #if ENABLE_FRILLS |
3305 | #if ENABLE_FRILLS |
3306 | if (options & Opt_tripleclickwords) |
3306 | if (OPTION (Opt_tripleclickwords)) |
3307 | { |
3307 | { |
3308 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3308 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3309 | |
3309 | |
3310 | for (int end_row = selection.mark.row; end_row < nrow; end_row++) |
3310 | for (int end_row = selection.mark.row; end_row < nrow; end_row++) |
3311 | { |
3311 | { |