1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: main.c |
2 | * File: main.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: main.C,v 1.17 2003/12/18 13:33:02 pcg Exp $ |
4 | * $Id: main.C,v 1.21 2004/01/29 23:26:01 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
8 | * - original version |
8 | * - original version |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
… | |
… | |
72 | { |
72 | { |
73 | free (p); |
73 | free (p); |
74 | } |
74 | } |
75 | |
75 | |
76 | rxvt_term::rxvt_term () |
76 | rxvt_term::rxvt_term () |
77 | : pty_ev (this, &rxvt_term::pty_cb), |
77 | : destroy_ev (this, &rxvt_term::destroy_cb), |
78 | #ifdef CURSOR_BLINK |
78 | #ifdef CURSOR_BLINK |
|
|
79 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
|
|
80 | #endif |
|
|
81 | #ifdef TEXT_BLINK |
79 | blink_ev (this, &rxvt_term::blink_cb), |
82 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
80 | #endif |
83 | #endif |
81 | #ifdef POINTER_BLANK |
84 | #ifdef POINTER_BLANK |
82 | pointer_ev (this, &rxvt_term::pointer_cb), |
85 | pointer_ev (this, &rxvt_term::pointer_cb), |
83 | #endif |
86 | #endif |
84 | x_ev (this, &rxvt_term::x_cb), |
87 | x_ev (this, &rxvt_term::x_cb), |
85 | destroy_ev (this, &rxvt_term::destroy_cb), |
|
|
86 | check_ev (this, &rxvt_term::check_cb), |
88 | check_ev (this, &rxvt_term::check_cb), |
87 | incr_ev (this, &rxvt_term::incr_cb) |
89 | incr_ev (this, &rxvt_term::incr_cb), |
|
|
90 | pty_ev (this, &rxvt_term::pty_cb) |
88 | { |
91 | { |
89 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
92 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
90 | } |
93 | } |
91 | |
94 | |
92 | rxvt_term::~rxvt_term () |
95 | rxvt_term::~rxvt_term () |
… | |
… | |
124 | { |
127 | { |
125 | check_ev.stop (); |
128 | check_ev.stop (); |
126 | pty_ev.stop (); |
129 | pty_ev.stop (); |
127 | x_ev.stop (); |
130 | x_ev.stop (); |
128 | #ifdef CURSOR_BLINK |
131 | #ifdef CURSOR_BLINK |
|
|
132 | cursor_blink_ev.stop (); |
|
|
133 | #endif |
|
|
134 | #ifdef TEXT_BLINK |
129 | blink_ev.stop (); |
135 | text_blink_ev.stop (); |
130 | #endif |
136 | #endif |
131 | #ifdef POINTER_BLANK |
137 | #ifdef POINTER_BLANK |
132 | pointer_ev.stop (); |
138 | pointer_ev.stop (); |
133 | #endif |
139 | #endif |
134 | |
140 | |
… | |
… | |
636 | * Called after a window size change. |
642 | * Called after a window size change. |
637 | */ |
643 | */ |
638 | void |
644 | void |
639 | rxvt_term::tt_winch () |
645 | rxvt_term::tt_winch () |
640 | { |
646 | { |
641 | struct winsize ws; |
647 | struct winsize ws; |
642 | |
648 | |
643 | if (cmd_fd < 0) |
649 | if (cmd_fd < 0) |
644 | return; |
650 | return; |
645 | |
651 | |
646 | ws.ws_col = TermWin.ncol; |
652 | ws.ws_col = TermWin.ncol; |
… | |
… | |
955 | } |
961 | } |
956 | |
962 | |
957 | if (fix_screen || old_height == 0) |
963 | if (fix_screen || old_height == 0) |
958 | { |
964 | { |
959 | int curr_screen = -1; |
965 | int curr_screen = -1; |
960 | uint16_t old_ncol = prev_ncol; |
966 | int old_ncol = prev_ncol; |
961 | |
967 | |
962 | /* scr_reset only works on the primary screen */ |
968 | /* scr_reset only works on the primary screen */ |
963 | if (old_height) /* this is not the first time through */ |
969 | if (old_height) /* this is not the first time through */ |
|
|
970 | { |
|
|
971 | unsigned int ncol = TermWin.ncol; |
|
|
972 | TermWin.ncol = prev_ncol; // save b/c scr_blank_screen_mem uses this |
964 | curr_screen = rxvt_scr_change_screen (this, PRIMARY); |
973 | curr_screen = rxvt_scr_change_screen (this, PRIMARY); |
|
|
974 | TermWin.ncol = ncol; |
|
|
975 | } |
965 | |
976 | |
966 | scr_reset(); |
977 | scr_reset(); |
967 | |
978 | |
968 | if (curr_screen >= 0) /* this is not the first time through */ |
979 | if (curr_screen >= 0) /* this is not the first time through */ |
969 | { |
980 | { |