… | |
… | |
140 | free (p); |
140 | free (p); |
141 | } |
141 | } |
142 | |
142 | |
143 | rxvt_term::rxvt_term () |
143 | rxvt_term::rxvt_term () |
144 | : |
144 | : |
|
|
145 | #if TRANSPARENT |
145 | rootwin_ev (this, &rxvt_term::rootwin_cb), |
146 | rootwin_ev (this, &rxvt_term::rootwin_cb), |
|
|
147 | #endif |
|
|
148 | #ifdef HAVE_SCROLLBARS |
|
|
149 | scrollbar_ev (this, &rxvt_term::x_cb), |
|
|
150 | #endif |
|
|
151 | #ifdef MENUBAR |
|
|
152 | menubar_ev (this, &rxvt_term::x_cb), |
|
|
153 | #endif |
|
|
154 | #ifdef CURSOR_BLINK |
|
|
155 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
|
|
156 | #endif |
|
|
157 | #ifdef TEXT_BLINK |
|
|
158 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
|
|
159 | #endif |
|
|
160 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
161 | cont_scroll_ev (this, &rxvt_term::cont_scroll_cb), |
|
|
162 | #endif |
|
|
163 | #ifdef SELECTION_SCROLLING |
|
|
164 | sel_scroll_ev (this, &rxvt_term::sel_scroll_cb), |
|
|
165 | #endif |
|
|
166 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
|
|
167 | slip_wheel_ev (this, &rxvt_term::slip_wheel_cb), |
|
|
168 | #endif |
|
|
169 | #ifdef POINTER_BLANK |
|
|
170 | pointer_ev (this, &rxvt_term::pointer_cb), |
|
|
171 | #endif |
|
|
172 | #ifdef USE_XIM |
|
|
173 | im_ev (this, &rxvt_term::im_cb), |
|
|
174 | #endif |
146 | termwin_ev (this, &rxvt_term::x_cb), |
175 | termwin_ev (this, &rxvt_term::x_cb), |
147 | vt_ev (this, &rxvt_term::x_cb), |
176 | vt_ev (this, &rxvt_term::x_cb), |
148 | #ifdef HAVE_SCROLLBARS |
|
|
149 | scrollbar_ev (this, &rxvt_term::x_cb), |
|
|
150 | #endif |
|
|
151 | #ifdef MENUBAR |
|
|
152 | menubar_ev (this, &rxvt_term::x_cb), |
|
|
153 | #endif |
|
|
154 | #ifdef CURSOR_BLINK |
|
|
155 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
|
|
156 | #endif |
|
|
157 | #ifdef TEXT_BLINK |
|
|
158 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
|
|
159 | #endif |
|
|
160 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
161 | cont_scroll_ev (this, &rxvt_term::cont_scroll_cb), |
|
|
162 | #endif |
|
|
163 | #ifdef SELECTION_SCROLLING |
|
|
164 | sel_scroll_ev (this, &rxvt_term::sel_scroll_cb), |
|
|
165 | #endif |
|
|
166 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
|
|
167 | slip_wheel_ev (this, &rxvt_term::slip_wheel_cb), |
|
|
168 | #endif |
|
|
169 | #ifdef POINTER_BLANK |
|
|
170 | pointer_ev (this, &rxvt_term::pointer_cb), |
|
|
171 | #endif |
|
|
172 | #ifdef USE_XIM |
|
|
173 | im_ev (this, &rxvt_term::im_cb), |
|
|
174 | #endif |
|
|
175 | check_ev (this, &rxvt_term::check_cb), |
177 | check_ev (this, &rxvt_term::check_cb), |
176 | flush_ev (this, &rxvt_term::flush_cb), |
178 | flush_ev (this, &rxvt_term::flush_cb), |
177 | destroy_ev (this, &rxvt_term::destroy_cb), |
179 | destroy_ev (this, &rxvt_term::destroy_cb), |
178 | pty_ev (this, &rxvt_term::pty_cb), |
180 | pty_ev (this, &rxvt_term::pty_cb), |
179 | incr_ev (this, &rxvt_term::incr_cb) |
181 | incr_ev (this, &rxvt_term::incr_cb) |
… | |
… | |
201 | |
203 | |
202 | if (display) |
204 | if (display) |
203 | { |
205 | { |
204 | selection_clear (); |
206 | selection_clear (); |
205 | |
207 | |
|
|
208 | #ifdef USE_XIM |
|
|
209 | im_destroy (); |
|
|
210 | #endif |
206 | #ifdef MENUBAR |
211 | #ifdef MENUBAR |
207 | if (menubarGC) XFreeGC (display->display, menubarGC); |
212 | if (menubarGC) XFreeGC (display->display, menubarGC); |
208 | #endif |
213 | #endif |
209 | #ifdef XTERM_SCROLLBAR |
214 | #ifdef XTERM_SCROLLBAR |
210 | if (xscrollbarGC) XFreeGC (display->display, xscrollbarGC); |
215 | if (xscrollbarGC) XFreeGC (display->display, xscrollbarGC); |
… | |
… | |
274 | } |
279 | } |
275 | |
280 | |
276 | void |
281 | void |
277 | rxvt_term::destroy () |
282 | rxvt_term::destroy () |
278 | { |
283 | { |
|
|
284 | if (destroy_ev.active) |
|
|
285 | return; |
|
|
286 | |
279 | if (display) |
287 | if (display) |
280 | { |
288 | { |
|
|
289 | #if USE_XIM |
|
|
290 | im_ev.stop (display); |
|
|
291 | #endif |
|
|
292 | #if HAVE_SCROLLBARS |
|
|
293 | scrollbar_ev.stop (display); |
|
|
294 | #endif |
|
|
295 | #if MENUBAR |
|
|
296 | menubar_ev.stop (display); |
|
|
297 | #endif |
|
|
298 | #if TRANSPARENT |
281 | rootwin_ev.stop (display); |
299 | rootwin_ev.stop (display); |
|
|
300 | #endif |
|
|
301 | incr_ev.stop (); |
282 | termwin_ev.stop (display); |
302 | termwin_ev.stop (display); |
283 | vt_ev.stop (display); |
303 | vt_ev.stop (display); |
284 | #ifdef USE_XIM |
|
|
285 | im_destroy (); |
|
|
286 | im_ev.stop (display); |
|
|
287 | #endif |
|
|
288 | #ifdef HAVE_SCROLLBARS |
|
|
289 | scrollbar_ev.stop (display); |
|
|
290 | #endif |
|
|
291 | #ifdef MENUBAR |
|
|
292 | menubar_ev.stop (display); |
|
|
293 | #endif |
|
|
294 | } |
304 | } |
295 | |
305 | |
296 | check_ev.stop (); |
306 | check_ev.stop (); |
297 | pty_ev.stop (); |
307 | pty_ev.stop (); |
298 | #ifdef CURSOR_BLINK |
308 | #ifdef CURSOR_BLINK |
… | |
… | |
377 | #ifdef TRANSPARENT |
387 | #ifdef TRANSPARENT |
378 | if (Options & Opt_transparent) |
388 | if (Options & Opt_transparent) |
379 | { |
389 | { |
380 | XSelectInput (display->display, display->root, PropertyChangeMask); |
390 | XSelectInput (display->display, display->root, PropertyChangeMask); |
381 | check_our_parents (); |
391 | check_our_parents (); |
382 | } |
|
|
383 | #endif |
|
|
384 | |
|
|
385 | rootwin_ev.start (display, display->root); |
392 | rootwin_ev.start (display, display->root); |
|
|
393 | } |
|
|
394 | #endif |
386 | |
395 | |
387 | XMapWindow (display->display, TermWin.vt); |
396 | XMapWindow (display->display, TermWin.vt); |
388 | XMapWindow (display->display, TermWin.parent[0]); |
397 | XMapWindow (display->display, TermWin.parent[0]); |
389 | |
398 | |
390 | init_command (cmd_argv); |
399 | init_command (cmd_argv); |
… | |
… | |
1231 | if (width == 0) |
1240 | if (width == 0) |
1232 | width = wattr.width - szHint.base_width; |
1241 | width = wattr.width - szHint.base_width; |
1233 | if (height == 0) |
1242 | if (height == 0) |
1234 | height = wattr.height - szHint.base_height; |
1243 | height = wattr.height - szHint.base_height; |
1235 | } |
1244 | } |
|
|
1245 | |
1236 | if (width != TermWin.width || height != TermWin.height) |
1246 | if (width != TermWin.width || height != TermWin.height) |
1237 | { |
1247 | { |
1238 | width += szHint.base_width; |
1248 | width += szHint.base_width; |
1239 | height += szHint.base_height; |
1249 | height += szHint.base_height; |
1240 | resize_all_windows (width, height, 0); |
1250 | resize_all_windows (width, height, 0); |