… | |
… | |
15 | * - extensive modifications |
15 | * - extensive modifications |
16 | * Copyright (c) 2003-2010 Marc Lehmann <schmorp@schmorp.de> |
16 | * Copyright (c) 2003-2010 Marc Lehmann <schmorp@schmorp.de> |
17 | * |
17 | * |
18 | * This program is free software; you can redistribute it and/or modify |
18 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License as published by |
19 | * it under the terms of the GNU General Public License as published by |
20 | * the Free Software Foundation; either version 2 of the License, or |
20 | * the Free Software Foundation; either version 3 of the License, or |
21 | * (at your option) any later version. |
21 | * (at your option) any later version. |
22 | * |
22 | * |
23 | * This program is distributed in the hope that it will be useful, |
23 | * This program is distributed in the hope that it will be useful, |
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
… | |
… | |
168 | sel_scroll_ev.set <rxvt_term, &rxvt_term::sel_scroll_cb> (this); |
168 | sel_scroll_ev.set <rxvt_term, &rxvt_term::sel_scroll_cb> (this); |
169 | #endif |
169 | #endif |
170 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
170 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
171 | slip_wheel_ev.set <rxvt_term, &rxvt_term::slip_wheel_cb> (this); |
171 | slip_wheel_ev.set <rxvt_term, &rxvt_term::slip_wheel_cb> (this); |
172 | #endif |
172 | #endif |
173 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
173 | #if BG_IMAGE_FROM_ROOT || ENABLE_PERL |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
174 | rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), |
175 | #endif |
175 | #endif |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
176 | scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), |
177 | #if USE_XIM |
177 | #if USE_XIM |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
178 | im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), |
… | |
… | |
226 | |
226 | |
227 | #ifdef HAVE_BG_PIXMAP |
227 | #ifdef HAVE_BG_PIXMAP |
228 | bg_destroy (); |
228 | bg_destroy (); |
229 | #endif |
229 | #endif |
230 | |
230 | |
|
|
231 | #if HAVE_IMG |
|
|
232 | delete bg_img; |
|
|
233 | #endif |
|
|
234 | |
231 | if (display) |
235 | if (display) |
232 | { |
236 | { |
233 | selection_clear (); |
237 | selection_clear (); |
234 | selection_clear (true); |
238 | selection_clear (true); |
235 | |
239 | |
236 | #if USE_XIM |
240 | #if USE_XIM |
237 | im_destroy (); |
241 | im_destroy (); |
238 | #endif |
242 | #endif |
239 | scrollBar.destroy (); |
243 | scrollBar.destroy (); |
|
|
244 | |
|
|
245 | if (gc) |
240 | if (gc) XFreeGC (dpy, gc); |
246 | XFreeGC (dpy, gc); |
241 | |
247 | |
242 | delete drawable; |
248 | delete drawable; |
|
|
249 | |
243 | // destroy all windows |
250 | // destroy all windows |
244 | if (parent) |
251 | if (parent) |
245 | XDestroyWindow (dpy, parent); |
252 | XDestroyWindow (dpy, parent); |
246 | |
253 | |
247 | for (int i = 0; i < TOTAL_COLORS; i++) |
254 | for (int i = 0; i < TOTAL_COLORS; i++) |
… | |
… | |
270 | free (locale); |
277 | free (locale); |
271 | free (v_buffer); |
278 | free (v_buffer); |
272 | |
279 | |
273 | delete selection_req; |
280 | delete selection_req; |
274 | |
281 | |
|
|
282 | if (env && memcmp (env, envv->begin (), envv->size () * sizeof (char *))) |
|
|
283 | rxvt_warn ("env has been modified, probably as a result of a lib calling setenv.\n"); |
|
|
284 | |
|
|
285 | delete env; |
|
|
286 | |
275 | delete envv; |
287 | delete envv; |
276 | delete argv; |
288 | delete argv; |
277 | |
289 | |
278 | #ifdef KEYSYM_RESOURCE |
290 | #ifdef KEYSYM_RESOURCE |
279 | delete keyboard; |
291 | delete keyboard; |
… | |
… | |
311 | { |
323 | { |
312 | #if USE_XIM |
324 | #if USE_XIM |
313 | im_ev.stop (display); |
325 | im_ev.stop (display); |
314 | #endif |
326 | #endif |
315 | scrollbar_ev.stop (display); |
327 | scrollbar_ev.stop (display); |
316 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
328 | #if BG_IMAGE_FROM_ROOT || ENABLE_PERL |
317 | rootwin_ev.stop (display); |
329 | rootwin_ev.stop (display); |
318 | #endif |
330 | #endif |
319 | termwin_ev.stop (display); |
331 | termwin_ev.stop (display); |
320 | vt_ev.stop (display); |
332 | vt_ev.stop (display); |
321 | } |
333 | } |
… | |
… | |
817 | |
829 | |
818 | delete fontset[0]; |
830 | delete fontset[0]; |
819 | fontset[0] = fs; |
831 | fontset[0] = fs; |
820 | |
832 | |
821 | prop = (*fs)[rxvt_fontset::firstFont]->properties (); |
833 | prop = (*fs)[rxvt_fontset::firstFont]->properties (); |
822 | prop.width += letterSpace; |
834 | prop.width = max (prop.width + letterSpace, 1); |
823 | |
835 | |
824 | fs->set_prop (prop, false); |
836 | fs->set_prop (prop, false); |
825 | |
837 | |
826 | fwidth = prop.width; |
838 | fwidth = prop.width; |
827 | fheight = prop.height + lineSpace; |
839 | fheight = prop.height + lineSpace; |
… | |
… | |
1363 | unsigned long fg, bg; |
1375 | unsigned long fg, bg; |
1364 | const char *p; |
1376 | const char *p; |
1365 | char **s; |
1377 | char **s; |
1366 | XIMStyles *xim_styles; |
1378 | XIMStyles *xim_styles; |
1367 | |
1379 | |
1368 | set_environ (envv); |
1380 | set_environ (env); |
1369 | |
1381 | |
1370 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1382 | if (!((p = XSetLocaleModifiers (modifiers)) && *p)) |
1371 | return false; |
1383 | return false; |
1372 | |
1384 | |
1373 | input_method = display->get_xim (locale, modifiers); |
1385 | input_method = display->get_xim (locale, modifiers); |
1374 | if (input_method == NULL) |
1386 | if (input_method == NULL) |
1375 | return false; |
1387 | return false; |
… | |
… | |
1683 | rxvt_term::update_background () |
1695 | rxvt_term::update_background () |
1684 | { |
1696 | { |
1685 | if (update_background_ev.is_active ()) |
1697 | if (update_background_ev.is_active ()) |
1686 | return; |
1698 | return; |
1687 | |
1699 | |
1688 | bg_invalidate (); |
|
|
1689 | |
|
|
1690 | if (!mapped) |
|
|
1691 | return; |
|
|
1692 | |
|
|
1693 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1700 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1694 | |
1701 | |
1695 | if (to_wait <= 0.) |
1702 | if (to_wait <= 0.) |
1696 | bg_render (); |
1703 | bg_render (); |
1697 | else |
1704 | else |