diff options
| author | Richard M. Stallman | 1994-09-29 20:25:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-09-29 20:25:45 +0000 |
| commit | 53dfb388305ca534829dd14855624fb638a5799b (patch) | |
| tree | 841d4fb42d492dae5f069daf080b247a0767466c /src | |
| parent | 829f7f7ce35084a2ebb888b3dfd47c18c434e634 (diff) | |
| download | emacs-53dfb388305ca534829dd14855624fb638a5799b.tar.gz emacs-53dfb388305ca534829dd14855624fb638a5799b.zip | |
(Fset_face_attribute_internal): Mark frame garbaged whenever
any face's font or color is changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 265c67bcaad..3ddc6e5f78d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -995,6 +995,7 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |||
| 995 | struct frame *f; | 995 | struct frame *f; |
| 996 | int magic_p; | 996 | int magic_p; |
| 997 | int id; | 997 | int id; |
| 998 | int garbaged = 0; | ||
| 998 | 999 | ||
| 999 | CHECK_FRAME (frame, 0); | 1000 | CHECK_FRAME (frame, 0); |
| 1000 | CHECK_NUMBER (face_id, 0); | 1001 | CHECK_NUMBER (face_id, 0); |
| @@ -1019,18 +1020,23 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |||
| 1019 | face->font = font; | 1020 | face->font = font; |
| 1020 | if (frame_update_line_height (f)) | 1021 | if (frame_update_line_height (f)) |
| 1021 | x_set_window_size (f, 0, f->width, f->height); | 1022 | x_set_window_size (f, 0, f->width, f->height); |
| 1023 | /* Must clear cache, since it might contain the font | ||
| 1024 | we just got rid of. */ | ||
| 1025 | garbaged = 1; | ||
| 1022 | } | 1026 | } |
| 1023 | else if (EQ (attr_name, intern ("foreground"))) | 1027 | else if (EQ (attr_name, intern ("foreground"))) |
| 1024 | { | 1028 | { |
| 1025 | unsigned long new_color = load_color (f, attr_value); | 1029 | unsigned long new_color = load_color (f, attr_value); |
| 1026 | unload_color (f, face->foreground); | 1030 | unload_color (f, face->foreground); |
| 1027 | face->foreground = new_color; | 1031 | face->foreground = new_color; |
| 1032 | garbaged = 1; | ||
| 1028 | } | 1033 | } |
| 1029 | else if (EQ (attr_name, intern ("background"))) | 1034 | else if (EQ (attr_name, intern ("background"))) |
| 1030 | { | 1035 | { |
| 1031 | unsigned long new_color = load_color (f, attr_value); | 1036 | unsigned long new_color = load_color (f, attr_value); |
| 1032 | unload_color (f, face->background); | 1037 | unload_color (f, face->background); |
| 1033 | face->background = new_color; | 1038 | face->background = new_color; |
| 1039 | garbaged = 1; | ||
| 1034 | } | 1040 | } |
| 1035 | #if 0 | 1041 | #if 0 |
| 1036 | else if (EQ (attr_name, intern ("background-pixmap"))) | 1042 | else if (EQ (attr_name, intern ("background-pixmap"))) |
| @@ -1057,16 +1063,13 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |||
| 1057 | if (id == 0 || id == 1) | 1063 | if (id == 0 || id == 1) |
| 1058 | recompute_basic_faces (f); | 1064 | recompute_basic_faces (f); |
| 1059 | 1065 | ||
| 1060 | /* If we're modifying either of the frame's display faces, that | 1066 | /* We must redraw the frame whenever any face font or color changes, |
| 1061 | means that we're changing the parameters of a fixed face code; | 1067 | because it's possible that a merged (display) face |
| 1062 | since the color/font/whatever is changed but the face ID hasn't, | 1068 | contains the font or color we just replaced. |
| 1063 | redisplay won't know to redraw the affected sections. Give it a | 1069 | And we must inhibit any Expose events until the redraw is done, |
| 1064 | kick. */ | 1070 | since they would try to use the invalid display faces. */ |
| 1065 | if (id == 0 || id == 1) | 1071 | if (garbaged) |
| 1066 | SET_FRAME_GARBAGED (f); | 1072 | SET_FRAME_GARBAGED (f); |
| 1067 | else | ||
| 1068 | /* Otherwise, it's enough to tell it to redisplay the text. */ | ||
| 1069 | windows_or_buffers_changed = 1; | ||
| 1070 | 1073 | ||
| 1071 | return Qnil; | 1074 | return Qnil; |
| 1072 | } | 1075 | } |