… | |
… | |
105 | if (cc->c2 == c2) return c1; |
105 | if (cc->c2 == c2) return c1; |
106 | cc = (*this)[cc->c1]; |
106 | cc = (*this)[cc->c1]; |
107 | } |
107 | } |
108 | |
108 | |
109 | // check to see whether this combination already exists otherwise |
109 | // check to see whether this combination already exists otherwise |
110 | for (cc = v.end (); cc-- > v.begin (); ) |
110 | for (cc = v.begin (); cc < v.end (); cc++) |
111 | if (cc->c1 == c1 && cc->c2 == c2) |
111 | if (cc->c1 == c1 && cc->c2 == c2) |
112 | return COMPOSE_LO + (cc - v.begin ()); |
112 | return COMPOSE_LO + (cc - v.begin ()); |
113 | |
113 | |
114 | // allocate a new combination |
114 | // allocate a new combination |
115 | if (v.size () == COMPOSE_HI - COMPOSE_LO + 1) |
115 | if (v.size () == COMPOSE_HI - COMPOSE_LO + 1) |
… | |
… | |
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 | vt_width = ncol * fwidth; |
|
|
716 | vt_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. |
… | |
… | |
723 | |
729 | |
724 | struct winsize ws; |
730 | struct winsize ws; |
725 | |
731 | |
726 | ws.ws_col = ncol; |
732 | ws.ws_col = ncol; |
727 | ws.ws_row = nrow; |
733 | ws.ws_row = nrow; |
728 | ws.ws_xpixel = width; |
734 | ws.ws_xpixel = vt_width; |
729 | ws.ws_ypixel = height; |
735 | ws.ws_ypixel = vt_height; |
730 | ioctl (pty->pty, TIOCSWINSZ, &ws); |
736 | ioctl (pty->pty, TIOCSWINSZ, &ws); |
731 | |
737 | |
732 | #if 0 |
738 | #if 0 |
733 | // TIOCSWINSZ is supposed to do this automatically and correctly |
739 | // TIOCSWINSZ is supposed to do this automatically and correctly |
734 | if (cmd_pid) /* force through to the command */ |
740 | if (cmd_pid) /* force through to the command */ |
… | |
… | |
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 |
… | |
… | |
1066 | if (scrollBar.state) |
1075 | if (scrollBar.state) |
1067 | scrollBar.resize (); |
1076 | scrollBar.resize (); |
1068 | |
1077 | |
1069 | XMoveResizeWindow (dpy, vt, |
1078 | XMoveResizeWindow (dpy, vt, |
1070 | window_vt_x, window_vt_y, |
1079 | window_vt_x, window_vt_y, |
1071 | width, height); |
1080 | vt_width, vt_height); |
1072 | |
1081 | |
1073 | #ifdef HAVE_BG_PIXMAP |
1082 | #ifdef HAVE_BG_PIXMAP |
1074 | if (bg_window_size_sensitive ()) |
1083 | if (bg_window_size_sensitive ()) |
1075 | update_background (); |
1084 | update_background (); |
1076 | #endif |
1085 | #endif |
… | |
… | |
1101 | newwidth = wattr.width - szHint.base_width; |
1110 | newwidth = wattr.width - szHint.base_width; |
1102 | if (newheight == 0) |
1111 | if (newheight == 0) |
1103 | newheight = wattr.height - szHint.base_height; |
1112 | newheight = wattr.height - szHint.base_height; |
1104 | } |
1113 | } |
1105 | |
1114 | |
1106 | if (newwidth != width || newheight != height) |
1115 | if (newwidth != vt_width || newheight != vt_height) |
1107 | { |
1116 | { |
1108 | newwidth += szHint.base_width; |
1117 | newwidth += szHint.base_width; |
1109 | newheight += szHint.base_height; |
1118 | newheight += szHint.base_height; |
1110 | resize_all_windows (newwidth, newheight, 0); |
1119 | resize_all_windows (newwidth, newheight, 0); |
1111 | } |
1120 | } |
… | |
… | |
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 |