diff options
| author | Gerd Moellmann | 2001-08-22 09:44:15 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-08-22 09:44:15 +0000 |
| commit | ceeda019c038432b3fdf792698ee47d894e51d78 (patch) | |
| tree | 54424a0bafd28ae7da31c7324d46646971f6b4b8 /src | |
| parent | 90893c55a8e506342be3963b1a5dccb22f8dd8c3 (diff) | |
| download | emacs-ceeda019c038432b3fdf792698ee47d894e51d78.tar.gz emacs-ceeda019c038432b3fdf792698ee47d894e51d78.zip | |
(menu_face_changed_default): New variable.
(menu_face_changed_count): Variable removed.
(Finternal_set_lisp_face_attribute): Doc fix. If FRAME is t, set
the menu_face_changed_default flag, otherwise set the FRAME's
menu_face_changed_p flag if the `menu' face has been changed.
Prevent calling set_font_frame_param if FRAME is t.
(make_face_cache): Initialize cache's menu_face_changed_p
from menu_face_changed_default.
(realize_basic_faces): Look into the frame's face cache to
determine if the menu appearance needs updating.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index e0287a87609..e39dfe214f7 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -473,10 +473,6 @@ static int clear_font_table_count; | |||
| 473 | 473 | ||
| 474 | int face_change_count; | 474 | int face_change_count; |
| 475 | 475 | ||
| 476 | /* Incremented for every change in the `menu' face. */ | ||
| 477 | |||
| 478 | int menu_face_change_count; | ||
| 479 | |||
| 480 | /* Non-zero means don't display bold text if a face's foreground | 476 | /* Non-zero means don't display bold text if a face's foreground |
| 481 | and background colors are the inverse of the default colors of the | 477 | and background colors are the inverse of the default colors of the |
| 482 | display. This is a kluge to suppress `bold black' foreground text | 478 | display. This is a kluge to suppress `bold black' foreground text |
| @@ -497,6 +493,10 @@ static int npixmaps_allocated; | |||
| 497 | static int ngcs; | 493 | static int ngcs; |
| 498 | #endif | 494 | #endif |
| 499 | 495 | ||
| 496 | /* Non-zero means the definition of the `menu' face for new frames has | ||
| 497 | been changed. */ | ||
| 498 | |||
| 499 | int menu_face_changed_default; | ||
| 500 | 500 | ||
| 501 | 501 | ||
| 502 | /* Function prototypes. */ | 502 | /* Function prototypes. */ |
| @@ -3770,7 +3770,7 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, | |||
| 3770 | Sinternal_set_lisp_face_attribute, 3, 4, 0, | 3770 | Sinternal_set_lisp_face_attribute, 3, 4, 0, |
| 3771 | "Set attribute ATTR of FACE to VALUE.\n\ | 3771 | "Set attribute ATTR of FACE to VALUE.\n\ |
| 3772 | FRAME being a frame means change the face on that frame.\n\ | 3772 | FRAME being a frame means change the face on that frame.\n\ |
| 3773 | FRAME nil means change change the face of the selected frame.\n\ | 3773 | FRAME nil means change the face of the selected frame.\n\ |
| 3774 | FRAME t means change the default for new frames.\n\ | 3774 | FRAME t means change the default for new frames.\n\ |
| 3775 | FRAME 0 means change the face on all frames, and change the default\n\ | 3775 | FRAME 0 means change the face on all frames, and change the default\n\ |
| 3776 | for new frames.") | 3776 | for new frames.") |
| @@ -4126,7 +4126,8 @@ FRAME 0 means change the face on all frames, and change the default\n\ | |||
| 4126 | #ifdef HAVE_WINDOW_SYSTEM | 4126 | #ifdef HAVE_WINDOW_SYSTEM |
| 4127 | /* Changed font-related attributes of the `default' face are | 4127 | /* Changed font-related attributes of the `default' face are |
| 4128 | reflected in changed `font' frame parameters. */ | 4128 | reflected in changed `font' frame parameters. */ |
| 4129 | if ((font_related_attr_p || font_attr_p) | 4129 | if (FRAMEP (frame) |
| 4130 | && (font_related_attr_p || font_attr_p) | ||
| 4130 | && lface_fully_specified_p (XVECTOR (lface)->contents)) | 4131 | && lface_fully_specified_p (XVECTOR (lface)->contents)) |
| 4131 | set_font_frame_param (frame, lface); | 4132 | set_font_frame_param (frame, lface); |
| 4132 | else | 4133 | else |
| @@ -4172,7 +4173,21 @@ FRAME 0 means change the face on all frames, and change the default\n\ | |||
| 4172 | } | 4173 | } |
| 4173 | #endif /* HAVE_WINDOW_SYSTEM */ | 4174 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 4174 | else if (EQ (face, Qmenu)) | 4175 | else if (EQ (face, Qmenu)) |
| 4175 | ++menu_face_change_count; | 4176 | { |
| 4177 | /* Indicate that we have to update the menu bar when | ||
| 4178 | realizing faces on FRAME. FRAME t change the | ||
| 4179 | default for new frames. We do this by setting | ||
| 4180 | setting the flag in new face caches */ | ||
| 4181 | if (FRAMEP (frame)) | ||
| 4182 | { | ||
| 4183 | struct frame *f = XFRAME (frame); | ||
| 4184 | if (FRAME_FACE_CACHE (f) == NULL) | ||
| 4185 | FRAME_FACE_CACHE (f) = make_face_cache (f); | ||
| 4186 | FRAME_FACE_CACHE (f)->menu_face_changed_p = 1; | ||
| 4187 | } | ||
| 4188 | else | ||
| 4189 | menu_face_changed_default = 1; | ||
| 4190 | } | ||
| 4176 | 4191 | ||
| 4177 | if (!NILP (param)) | 4192 | if (!NILP (param)) |
| 4178 | if (EQ (frame, Qt)) | 4193 | if (EQ (frame, Qt)) |
| @@ -4970,6 +4985,7 @@ make_face_cache (f) | |||
| 4970 | c->size = 50; | 4985 | c->size = 50; |
| 4971 | c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); | 4986 | c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); |
| 4972 | c->f = f; | 4987 | c->f = f; |
| 4988 | c->menu_face_changed_p = menu_face_changed_default; | ||
| 4973 | return c; | 4989 | return c; |
| 4974 | } | 4990 | } |
| 4975 | 4991 | ||
| @@ -6054,9 +6070,9 @@ realize_basic_faces (f) | |||
| 6054 | realize_named_face (f, Qmenu, MENU_FACE_ID); | 6070 | realize_named_face (f, Qmenu, MENU_FACE_ID); |
| 6055 | 6071 | ||
| 6056 | /* Reflect changes in the `menu' face in menu bars. */ | 6072 | /* Reflect changes in the `menu' face in menu bars. */ |
| 6057 | if (menu_face_change_count) | 6073 | if (FRAME_FACE_CACHE (f)->menu_face_changed_p) |
| 6058 | { | 6074 | { |
| 6059 | --menu_face_change_count; | 6075 | FRAME_FACE_CACHE (f)->menu_face_changed_p = 0; |
| 6060 | #ifdef USE_X_TOOLKIT | 6076 | #ifdef USE_X_TOOLKIT |
| 6061 | x_update_menu_appearance (f); | 6077 | x_update_menu_appearance (f); |
| 6062 | #endif | 6078 | #endif |