… | |
… | |
556 | D_SCREEN ((stderr, "rxvt_scr_change_screen (%d)", scrn)); |
556 | D_SCREEN ((stderr, "rxvt_scr_change_screen (%d)", scrn)); |
557 | |
557 | |
558 | TermWin.view_start = 0; |
558 | TermWin.view_start = 0; |
559 | |
559 | |
560 | if (current_screen == scrn) |
560 | if (current_screen == scrn) |
561 | return current_screen; |
561 | return scrn; |
562 | |
562 | |
563 | selection_check (2); /* check for boundary cross */ |
563 | selection_check (2); /* check for boundary cross */ |
564 | |
564 | |
565 | SWAP_IT (current_screen, scrn, int); |
565 | SWAP_IT (current_screen, scrn, int); |
566 | #if NSCREENS |
566 | #if NSCREENS |
|
|
567 | if (Options & Opt_secondaryScreen) |
|
|
568 | { |
567 | num_scr = 0; |
569 | num_scr = 0; |
568 | offset = TermWin.saveLines; |
570 | offset = TermWin.saveLines; |
569 | for (i = prev_nrow; i--;) |
571 | for (i = prev_nrow; i--;) |
570 | { |
572 | { |
571 | SWAP_IT (screen.text[i + offset], swap.text[i], text_t *); |
573 | SWAP_IT (screen.text[i + offset], swap.text[i], text_t *); |
572 | SWAP_IT (screen.tlen[i + offset], swap.tlen[i], int16_t); |
574 | SWAP_IT (screen.tlen[i + offset], swap.tlen[i], int16_t); |
573 | SWAP_IT (screen.rend[i + offset], swap.rend[i], rend_t *); |
575 | SWAP_IT (screen.rend[i + offset], swap.rend[i], rend_t *); |
574 | } |
576 | } |
575 | SWAP_IT (screen.cur.row, swap.cur.row, int16_t); |
577 | SWAP_IT (screen.cur.row, swap.cur.row, int16_t); |
576 | SWAP_IT (screen.cur.col, swap.cur.col, int16_t); |
578 | SWAP_IT (screen.cur.col, swap.cur.col, int16_t); |
577 | # ifdef DEBUG_STRICT |
579 | # ifdef DEBUG_STRICT |
578 | assert ((screen.cur.row >= 0) && (screen.cur.row < prev_nrow)); |
580 | assert ((screen.cur.row >= 0) && (screen.cur.row < prev_nrow)); |
579 | assert ((screen.cur.col >= 0) && (screen.cur.col < prev_ncol)); |
581 | assert ((screen.cur.col >= 0) && (screen.cur.col < prev_ncol)); |
580 | # else /* drive with your eyes closed */ |
582 | # else /* drive with your eyes closed */ |
581 | MAX_IT (screen.cur.row, 0); |
583 | MAX_IT (screen.cur.row, 0); |
582 | MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); |
584 | MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); |
583 | MAX_IT (screen.cur.col, 0); |
585 | MAX_IT (screen.cur.col, 0); |
584 | MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1); |
586 | MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1); |
585 | # endif |
587 | # endif |
586 | SWAP_IT (screen.charset, swap.charset, int16_t); |
588 | SWAP_IT (screen.charset, swap.charset, int16_t); |
587 | SWAP_IT (screen.flags, swap.flags, int); |
589 | SWAP_IT (screen.flags, swap.flags, int); |
588 | screen.flags |= Screen_VisibleCursor; |
590 | screen.flags |= Screen_VisibleCursor; |
589 | swap.flags |= Screen_VisibleCursor; |
591 | swap.flags |= Screen_VisibleCursor; |
590 | #else |
592 | } |
591 | # ifdef SCROLL_ON_NO_SECONDARY |
593 | else |
|
|
594 | #endif |
|
|
595 | if (Options & Opt_secondaryScroll) |
592 | if (current_screen == PRIMARY) |
596 | //if (current_screen == PRIMARY) |
593 | scr_scroll_text (0, (prev_nrow - 1), prev_nrow, 0); |
597 | scr_scroll_text (0, (prev_nrow - 1), prev_nrow, 0); |
594 | # endif |
|
|
595 | #endif |
|
|
596 | return scrn; |
598 | return scrn; |
597 | } |
599 | } |
598 | |
600 | |
599 | /* ------------------------------------------------------------------------- */ |
601 | /* ------------------------------------------------------------------------- */ |
600 | /* |
602 | /* |
… | |
… | |
642 | return 0; |
644 | return 0; |
643 | |
645 | |
644 | want_refresh = 1; |
646 | want_refresh = 1; |
645 | D_SCREEN ((stderr, "rxvt_scroll_text (%d,%d,%d,%d): %s", row1, row2, count, spec, (current_screen == PRIMARY) ? "Primary" : "Secondary")); |
647 | D_SCREEN ((stderr, "rxvt_scroll_text (%d,%d,%d,%d): %s", row1, row2, count, spec, (current_screen == PRIMARY) ? "Primary" : "Secondary")); |
646 | |
648 | |
647 | if ((count > 0) && (row1 == 0) && (current_screen == PRIMARY)) |
649 | if (row1 == 0 && count > 0 |
|
|
650 | && (current_screen == PRIMARY || Options & Opt_secondaryScroll)) |
648 | { |
651 | { |
649 | nscrolled = (long)TermWin.nscrolled + (long)count; |
652 | nscrolled = (long)TermWin.nscrolled + (long)count; |
650 | |
653 | |
651 | if (nscrolled > (long)TermWin.saveLines) |
654 | if (nscrolled > (long)TermWin.saveLines) |
652 | TermWin.nscrolled = TermWin.saveLines; |
655 | TermWin.nscrolled = TermWin.saveLines; |