… | |
… | |
254 | for (int i = 0; i < TOTAL_COLORS; i++) |
254 | for (int i = 0; i < TOTAL_COLORS; i++) |
255 | if (ISSET_PIXCOLOR (i)) |
255 | if (ISSET_PIXCOLOR (i)) |
256 | { |
256 | { |
257 | pix_colors_focused [i].free (this); |
257 | pix_colors_focused [i].free (this); |
258 | #if OFF_FOCUS_FADING |
258 | #if OFF_FOCUS_FADING |
|
|
259 | if (rs[Rs_fade]) |
259 | pix_colors_unfocused [i].free (this); |
260 | pix_colors_unfocused [i].free (this); |
260 | #endif |
261 | #endif |
261 | } |
262 | } |
262 | |
263 | |
263 | clear (); |
264 | clear (); |
264 | |
265 | |
… | |
… | |
280 | delete selection_req; |
281 | delete selection_req; |
281 | |
282 | |
282 | if (env && memcmp (env, envv->begin (), envv->size () * sizeof (char *))) |
283 | 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 | rxvt_warn ("env has been modified, probably as a result of a lib calling setenv.\n"); |
284 | |
285 | |
285 | delete env; |
286 | delete [] env; |
286 | |
287 | |
287 | delete envv; |
288 | delete envv; |
288 | delete argv; |
289 | delete argv; |
289 | |
290 | |
290 | #ifdef KEYSYM_RESOURCE |
291 | #ifdef KEYSYM_RESOURCE |
… | |
… | |
941 | |
942 | |
942 | void |
943 | void |
943 | rxvt_term::set_window_color (int idx, const char *color) |
944 | rxvt_term::set_window_color (int idx, const char *color) |
944 | { |
945 | { |
945 | #ifdef XTERM_COLOR_CHANGE |
946 | #ifdef XTERM_COLOR_CHANGE |
946 | rxvt_color xcol; |
|
|
947 | |
|
|
948 | if (color == NULL || *color == '\0') |
947 | if (color == NULL || *color == '\0') |
949 | return; |
948 | return; |
950 | |
949 | |
951 | color = strdup (color); |
950 | color = strdup (color); |
952 | allocated.push_back ((void *)color); |
951 | allocated.push_back ((void *)color); |
… | |
… | |
958 | int i = atoi (color); |
957 | int i = atoi (color); |
959 | |
958 | |
960 | if (i >= 8 && i <= 15) |
959 | if (i >= 8 && i <= 15) |
961 | { |
960 | { |
962 | /* bright colors */ |
961 | /* bright colors */ |
963 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i - 8]; |
962 | alias_color (idx, minBrightCOLOR + i - 8); |
964 | goto done; |
963 | goto done; |
965 | } |
964 | } |
966 | |
965 | |
967 | if (i >= 0 && i <= 7) |
966 | if (i >= 0 && i <= 7) |
968 | { |
967 | { |
969 | /* normal colors */ |
968 | /* normal colors */ |
970 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
969 | alias_color (idx, minCOLOR + i); |
971 | goto done; |
970 | goto done; |
972 | } |
971 | } |
973 | } |
972 | } |
974 | |
973 | |
975 | set_color (xcol, color); |
974 | pix_colors_focused[idx].free (this); |
976 | |
975 | set_color (pix_colors_focused[idx], color); |
977 | /* |
|
|
978 | * FIXME: should free colors here, but no idea how to do it so instead, |
|
|
979 | * so just keep gobbling up the colormap |
|
|
980 | */ |
|
|
981 | |
|
|
982 | pix_colors_focused[idx] = xcol; |
|
|
983 | |
976 | |
984 | done: |
977 | done: |
985 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
978 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
986 | |
979 | |
987 | update_fade_color (idx); |
980 | update_fade_color (idx); |
988 | recolour_cursor (); |
981 | recolor_cursor (); |
989 | scr_recolour (); |
982 | scr_recolor (); |
990 | #endif /* XTERM_COLOR_CHANGE */ |
983 | #endif /* XTERM_COLOR_CHANGE */ |
991 | } |
984 | } |
992 | |
985 | |
993 | void |
986 | void |
994 | rxvt_term::recolour_cursor () |
987 | rxvt_term::recolor_cursor () |
995 | { |
988 | { |
996 | XColor fg, bg; |
989 | XColor fg, bg; |
997 | |
990 | |
998 | (ISSET_PIXCOLOR (Color_pointer_fg) |
991 | (ISSET_PIXCOLOR (Color_pointer_fg) |
999 | ? pix_colors_focused[Color_pointer_fg] |
992 | ? pix_colors_focused[Color_pointer_fg] |
… | |
… | |
1054 | } |
1047 | } |
1055 | |
1048 | |
1056 | void |
1049 | void |
1057 | rxvt_term::alias_color (int dst, int src) |
1050 | rxvt_term::alias_color (int dst, int src) |
1058 | { |
1051 | { |
|
|
1052 | pix_colors[dst].free (this); |
1059 | pix_colors[dst].set (this, rs[Rs_color + dst] = rs[Rs_color + src]); |
1053 | pix_colors[dst].set (this, rs[Rs_color + dst] = rs[Rs_color + src]); |
1060 | } |
1054 | } |
1061 | |
1055 | |
1062 | /* -------------------------------------------------------------------- * |
1056 | /* -------------------------------------------------------------------- * |
1063 | * - WINDOW RESIZING - * |
1057 | * - WINDOW RESIZING - * |