… | |
… | |
90 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
90 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
91 | #endif |
91 | #endif |
92 | #ifdef POINTER_BLANK |
92 | #ifdef POINTER_BLANK |
93 | pointer_ev (this, &rxvt_term::pointer_cb), |
93 | pointer_ev (this, &rxvt_term::pointer_cb), |
94 | #endif |
94 | #endif |
|
|
95 | #ifdef USE_XIM |
|
|
96 | im_ev (this, &rxvt_term::im_cb), |
|
|
97 | #endif |
95 | check_ev (this, &rxvt_term::check_cb), |
98 | check_ev (this, &rxvt_term::check_cb), |
96 | destroy_ev (this, &rxvt_term::destroy_cb), |
99 | destroy_ev (this, &rxvt_term::destroy_cb), |
97 | pty_ev (this, &rxvt_term::pty_cb), |
100 | pty_ev (this, &rxvt_term::pty_cb), |
98 | incr_ev (this, &rxvt_term::incr_cb), |
101 | incr_ev (this, &rxvt_term::incr_cb) |
99 | #ifdef USE_XIM |
|
|
100 | im_ev (this, &rxvt_term::im_cb) |
|
|
101 | #endif |
|
|
102 | { |
102 | { |
103 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
103 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
104 | } |
104 | } |
105 | |
105 | |
106 | rxvt_term::~rxvt_term () |
106 | rxvt_term::~rxvt_term () |
107 | { |
107 | { |
108 | if (cmd_fd >= 0) |
108 | if (cmd_fd >= 0) |
109 | close (cmd_fd); |
109 | close (cmd_fd); |
110 | |
110 | |
|
|
111 | #ifndef NO_SETOWNER_TTYDEV |
|
|
112 | privileged_ttydev (RESTORE); |
|
|
113 | #endif |
|
|
114 | #ifdef UTMP_SUPPORT |
|
|
115 | privileged_utmp (RESTORE); |
|
|
116 | #endif |
|
|
117 | |
|
|
118 | delete TermWin.fontset; |
|
|
119 | |
|
|
120 | if (display) |
|
|
121 | if (TermWin.parent[0]) |
|
|
122 | XDestroyWindow (display->display, TermWin.parent[0]); |
|
|
123 | |
|
|
124 | // TODO: free pixcolours, colours should become part of rxvt_display |
|
|
125 | |
|
|
126 | delete PixColors; |
|
|
127 | |
|
|
128 | displays.put (display); |
|
|
129 | |
111 | scr_release (); |
130 | scr_release (); |
112 | |
131 | |
|
|
132 | free (env_windowid); |
|
|
133 | free (env_display); |
|
|
134 | free (env_term); |
|
|
135 | free (env_colorfgbg); |
113 | free (locale); |
136 | free (locale); |
114 | free (codeset); |
137 | free (codeset); |
115 | |
138 | |
116 | #ifndef NO_SETOWNER_TTYDEV |
139 | delete envv; |
117 | privileged_ttydev (RESTORE); |
140 | delete argv; |
118 | #endif |
|
|
119 | #ifdef UTMP_SUPPORT |
|
|
120 | privileged_utmp (RESTORE); |
|
|
121 | #endif |
|
|
122 | |
|
|
123 | // TODO: free pixcolours, colours should become part of rxvt_display |
|
|
124 | |
|
|
125 | delete PixColors; |
|
|
126 | delete TermWin.fontset; |
|
|
127 | |
|
|
128 | displays.put (display); |
|
|
129 | } |
141 | } |
130 | |
142 | |
131 | void |
143 | void |
132 | rxvt_term::destroy () |
144 | rxvt_term::destroy () |
133 | { |
145 | { |
134 | if (display) |
146 | if (display) |
135 | { |
147 | { |
136 | if (TermWin.parent[0]) |
|
|
137 | XDestroyWindow (display->display, TermWin.parent[0]); |
|
|
138 | |
|
|
139 | rootwin_ev.stop (display); |
148 | rootwin_ev.stop (display); |
140 | termwin_ev.stop (display); |
149 | termwin_ev.stop (display); |
141 | vt_ev.stop (display); |
150 | vt_ev.stop (display); |
142 | |
|
|
143 | #ifdef USE_XIM |
151 | #ifdef USE_XIM |
144 | im_destroy (); |
152 | im_destroy (); |
145 | im_ev.stop (display); |
153 | im_ev.stop (display); |
146 | #endif |
154 | #endif |
147 | #ifdef HAVE_SCROLLBARS |
155 | #ifdef HAVE_SCROLLBARS |
… | |
… | |
257 | scr_reset (); /* initialize screen */ |
265 | scr_reset (); /* initialize screen */ |
258 | #ifdef RXVT_GRAPHICS |
266 | #ifdef RXVT_GRAPHICS |
259 | Gr_reset (); /* reset graphics */ |
267 | Gr_reset (); /* reset graphics */ |
260 | #endif |
268 | #endif |
261 | |
269 | |
262 | #if 0 |
270 | #if 1 |
263 | #ifdef DEBUG_X |
|
|
264 | XSynchronize (display->display, True); |
271 | XSynchronize (display->display, True); |
265 | #endif |
|
|
266 | #endif |
272 | #endif |
267 | |
273 | |
268 | #ifdef HAVE_SCROLLBARS |
274 | #ifdef HAVE_SCROLLBARS |
269 | if (Options & Opt_scrollBar) |
275 | if (Options & Opt_scrollBar) |
270 | resize_scrollbar (); /* create and map scrollbar */ |
276 | resize_scrollbar (); /* create and map scrollbar */ |
… | |
… | |
284 | rootwin_ev.start (display, display->root); |
290 | rootwin_ev.start (display, display->root); |
285 | |
291 | |
286 | XMapWindow (display->display, TermWin.vt); |
292 | XMapWindow (display->display, TermWin.vt); |
287 | XMapWindow (display->display, TermWin.parent[0]); |
293 | XMapWindow (display->display, TermWin.parent[0]); |
288 | |
294 | |
289 | init_env (); |
|
|
290 | init_command (cmd_argv); |
295 | init_command (cmd_argv); |
291 | |
296 | |
292 | pty_ev.start (cmd_fd, EVENT_READ); |
297 | pty_ev.start (cmd_fd, EVENT_READ); |
293 | |
298 | |
294 | check_ev.start (); |
299 | check_ev.start (); |
… | |
… | |
873 | #ifdef XPM_BACKGROUND |
878 | #ifdef XPM_BACKGROUND |
874 | xpmb = "default;"; |
879 | xpmb = "default;"; |
875 | #endif |
880 | #endif |
876 | break; |
881 | break; |
877 | } |
882 | } |
|
|
883 | |
878 | sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); |
884 | sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); |
879 | putenv (env_colorfgbg); |
|
|
880 | |
885 | |
881 | #ifndef NO_BRIGHTCOLOR |
886 | #ifndef NO_BRIGHTCOLOR |
882 | colorfgbg = DEFAULT_RSTYLE; |
887 | colorfgbg = DEFAULT_RSTYLE; |
883 | for (i = minCOLOR; i <= maxCOLOR; i++) |
888 | for (i = minCOLOR; i <= maxCOLOR; i++) |
884 | { |
889 | { |