… | |
… | |
267 | for (int i = 0; i < allocated.size (); i++) |
267 | for (int i = 0; i < allocated.size (); i++) |
268 | free (allocated [i]); |
268 | free (allocated [i]); |
269 | |
269 | |
270 | free (selection.text); |
270 | free (selection.text); |
271 | free (selection.clip_text); |
271 | free (selection.clip_text); |
272 | // TODO: manage env vars in child only(!) |
|
|
273 | free (env_display); |
|
|
274 | free (env_term); |
|
|
275 | free (locale); |
272 | free (locale); |
276 | free (v_buffer); |
273 | free (v_buffer); |
277 | |
274 | |
278 | delete selection_req; |
275 | delete selection_req; |
279 | |
276 | |
… | |
… | |
706 | if (recalc_y) |
703 | if (recalc_y) |
707 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
704 | szHint.y += DisplayHeight (dpy, display->screen) - szHint.height - 2 * ext_bwidth; |
708 | |
705 | |
709 | ncol = width / fwidth; |
706 | ncol = width / fwidth; |
710 | nrow = height / fheight; |
707 | nrow = height / fheight; |
|
|
708 | |
|
|
709 | // When the size of the vt window is not a multiple of the cell |
|
|
710 | // size, i.e., when the wm does not honour our size hints, there are |
|
|
711 | // extra areas not covered by the terminal screen. Such gaps, when a |
|
|
712 | // bg pixmap is set, would have to be cleared manually to properly |
|
|
713 | // refresh the background. We take the simpler route and shrink the |
|
|
714 | // vt window so as to avoid creating gaps. |
|
|
715 | width = ncol * fwidth; |
|
|
716 | height = nrow * fheight; |
711 | } |
717 | } |
712 | |
718 | |
713 | /*----------------------------------------------------------------------*/ |
719 | /*----------------------------------------------------------------------*/ |
714 | /* |
720 | /* |
715 | * Tell the teletype handler what size the window is. |
721 | * Tell the teletype handler what size the window is. |
… | |
… | |
938 | |
944 | |
939 | /*----------------------------------------------------------------------*/ |
945 | /*----------------------------------------------------------------------*/ |
940 | /* |
946 | /* |
941 | * find if fg/bg matches any of the normal (low-intensity) colors |
947 | * find if fg/bg matches any of the normal (low-intensity) colors |
942 | */ |
948 | */ |
943 | void |
949 | char * |
944 | rxvt_term::set_colorfgbg () |
950 | rxvt_term::get_colorfgbg () |
945 | { |
951 | { |
946 | unsigned int i; |
952 | unsigned int i; |
947 | const char *xpmb = ""; |
953 | const char *xpmb = ""; |
948 | char fstr[] = "default"; |
954 | char fstr[] = "default"; |
949 | char bstr[] = "default"; |
955 | char bstr[] = "default"; |
|
|
956 | char *env_colorfgbg; |
950 | |
957 | |
951 | for (i = Color_Black; i <= Color_White; i++) |
958 | for (i = Color_Black; i <= Color_White; i++) |
952 | if (pix_colors[Color_fg] == pix_colors[i]) |
959 | if (pix_colors[Color_fg] == pix_colors[i]) |
953 | { |
960 | { |
954 | sprintf (fstr, "%d", i - Color_Black); |
961 | sprintf (fstr, "%d", i - Color_Black); |
… | |
… | |
963 | xpmb = "default;"; |
970 | xpmb = "default;"; |
964 | #endif |
971 | #endif |
965 | break; |
972 | break; |
966 | } |
973 | } |
967 | |
974 | |
|
|
975 | env_colorfgbg = (char *)rxvt_malloc (sizeof ("COLORFGBG=default;default;bg")); |
968 | sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); |
976 | sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); |
|
|
977 | return env_colorfgbg; |
969 | } |
978 | } |
970 | |
979 | |
971 | /*----------------------------------------------------------------------*/ |
980 | /*----------------------------------------------------------------------*/ |
972 | |
981 | |
973 | bool |
982 | bool |
… | |
… | |
1650 | if (update_background_ev.is_active ()) |
1659 | if (update_background_ev.is_active ()) |
1651 | return; |
1660 | return; |
1652 | |
1661 | |
1653 | bg_invalidate (); |
1662 | bg_invalidate (); |
1654 | |
1663 | |
|
|
1664 | if (!mapped) |
|
|
1665 | return; |
|
|
1666 | |
1655 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1667 | ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); |
1656 | |
1668 | |
1657 | if (to_wait <= 0.) |
1669 | if (to_wait <= 0.) |
1658 | bg_render (); |
1670 | bg_render (); |
1659 | else |
1671 | else |