… | |
… | |
252 | delete drawable; |
252 | delete drawable; |
253 | // destroy all windows |
253 | // destroy all windows |
254 | if (parent[0]) |
254 | if (parent[0]) |
255 | XDestroyWindow (xdisp, parent[0]); |
255 | XDestroyWindow (xdisp, parent[0]); |
256 | |
256 | |
|
|
257 | for (int i = 0; i < TOTAL_COLORS; i++) |
|
|
258 | if (ISSET_PIXCOLOR (i)) |
|
|
259 | { |
|
|
260 | pix_colors_focused [i].free (this); |
|
|
261 | #if OFF_FOCUS_FADING |
|
|
262 | pix_colors_unfocused [i].free (this); |
|
|
263 | #endif |
|
|
264 | } |
|
|
265 | |
257 | clear (); |
266 | clear (); |
258 | } |
267 | } |
259 | |
268 | |
260 | // TODO: free pixcolours, colours should become part of rxvt_display |
|
|
261 | delete pix_colors_focused; |
269 | delete pix_colors_focused; |
262 | #if OFF_FOCUS_FADING |
270 | #if OFF_FOCUS_FADING |
263 | delete pix_colors_unfocused; |
271 | delete pix_colors_unfocused; |
264 | #endif |
272 | #endif |
265 | |
273 | |
… | |
… | |
691 | |
699 | |
692 | if (scrollBar.state) |
700 | if (scrollBar.state) |
693 | { |
701 | { |
694 | sb_w = scrollbar_TotalWidth (); |
702 | sb_w = scrollbar_TotalWidth (); |
695 | szHint.base_width += sb_w; |
703 | szHint.base_width += sb_w; |
|
|
704 | |
696 | if (!OPTION (Opt_scrollBar_right)) |
705 | if (!OPTION (Opt_scrollBar_right)) |
697 | window_vt_x += sb_w; |
706 | window_vt_x += sb_w; |
698 | } |
707 | } |
699 | |
708 | |
700 | szHint.width_inc = fwidth; |
709 | szHint.width_inc = fwidth; |
… | |
… | |
931 | |
940 | |
932 | #if OFF_FOCUS_FADING |
941 | #if OFF_FOCUS_FADING |
933 | if (rs[Rs_fade]) |
942 | if (rs[Rs_fade]) |
934 | { |
943 | { |
935 | rgba c; |
944 | rgba c; |
936 | pix_colors [Color_fade].get (this, c); |
945 | pix_colors [Color_fade].get (c); |
937 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
946 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
938 | } |
947 | } |
939 | #endif |
948 | #endif |
940 | |
949 | |
941 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
950 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
… | |
… | |
949 | #endif /* XTERM_COLOR_CHANGE */ |
958 | #endif /* XTERM_COLOR_CHANGE */ |
950 | |
959 | |
951 | void |
960 | void |
952 | rxvt_term::recolour_cursor () |
961 | rxvt_term::recolour_cursor () |
953 | { |
962 | { |
954 | XColor xcol[2]; |
963 | XColor fg, bg; |
955 | |
964 | |
956 | xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) |
965 | (ISSET_PIXCOLOR (Color_pointer_fg) |
957 | ? pix_colors_focused[Color_pointer_fg] |
966 | ? pix_colors_focused[Color_pointer_fg] |
958 | : pix_colors_focused[Color_fg]; |
967 | : pix_colors_focused[Color_fg]).get (fg); |
|
|
968 | |
959 | xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) |
969 | (ISSET_PIXCOLOR (Color_pointer_bg) |
960 | ? pix_colors_focused[Color_pointer_bg] |
970 | ? pix_colors_focused[Color_pointer_bg] |
961 | : pix_colors_focused[Color_bg]; |
971 | : pix_colors_focused[Color_bg]).get (bg); |
962 | |
972 | |
963 | XQueryColors (xdisp, cmap, xcol, 2); |
|
|
964 | XRecolorCursor (xdisp, TermWin_cursor, xcol + 0, xcol + 1); |
973 | XRecolorCursor (xdisp, TermWin_cursor, &fg, &bg); |
965 | } |
974 | } |
966 | |
975 | |
967 | /*----------------------------------------------------------------------*/ |
976 | /*----------------------------------------------------------------------*/ |
968 | /* |
977 | /* |
969 | * find if fg/bg matches any of the normal (low-intensity) colors |
978 | * find if fg/bg matches any of the normal (low-intensity) colors |
… | |
… | |
1005 | if (color.set (this, name)) |
1014 | if (color.set (this, name)) |
1006 | return true; |
1015 | return true; |
1007 | |
1016 | |
1008 | rxvt_warn ("can't get colour '%s', continuing without.\n", name); |
1017 | rxvt_warn ("can't get colour '%s', continuing without.\n", name); |
1009 | return false; |
1018 | return false; |
|
|
1019 | } |
|
|
1020 | |
|
|
1021 | void |
|
|
1022 | rxvt_term::alias_color (int dst, int src) |
|
|
1023 | { |
|
|
1024 | pix_colors[dst].set (this, rs[Rs_color + dst] = rs[Rs_color + src]); |
1010 | } |
1025 | } |
1011 | |
1026 | |
1012 | /* -------------------------------------------------------------------- * |
1027 | /* -------------------------------------------------------------------- * |
1013 | * - WINDOW RESIZING - * |
1028 | * - WINDOW RESIZING - * |
1014 | * -------------------------------------------------------------------- */ |
1029 | * -------------------------------------------------------------------- */ |
… | |
… | |
1093 | } |
1108 | } |
1094 | |
1109 | |
1095 | if (fix_screen || old_height == 0) |
1110 | if (fix_screen || old_height == 0) |
1096 | scr_reset (); |
1111 | scr_reset (); |
1097 | |
1112 | |
|
|
1113 | // TODO, with nvidia-8178, resizes kill the alpha channel, report if not fixed in newer version |
|
|
1114 | //scr_touch (false); |
|
|
1115 | |
1098 | #ifdef XPM_BACKGROUND |
1116 | #ifdef XPM_BACKGROUND |
1099 | if (pixmap) |
1117 | if (pixmap) |
1100 | scr_touch (false); |
1118 | scr_touch (false); |
1101 | #endif |
1119 | #endif |
1102 | |
1120 | |
… | |
… | |
1138 | #ifdef USE_XIM |
1156 | #ifdef USE_XIM |
1139 | |
1157 | |
1140 | void |
1158 | void |
1141 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1159 | rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) |
1142 | { |
1160 | { |
1143 | fg = pix_colors[Color_fg]; |
1161 | fg = pix_colors [Color_fg]; |
1144 | bg = pix_colors[Color_bg]; |
1162 | bg = pix_colors [Color_bg]; |
1145 | } |
1163 | } |
1146 | |
1164 | |
1147 | void |
1165 | void |
1148 | rxvt_term::im_set_size (XRectangle &size) |
1166 | rxvt_term::im_set_size (XRectangle &size) |
1149 | { |
1167 | { |