# HG changeset patch # User Jim Blandy # Date 738785531 0 # Node ID 6fab7c7bb1f17ace10588ccb142e9f06ea950065 # Parent 0b96c67ca1c5b47ff14782a89c1322a8e9cc9d0a * xfaces.c (init_frame_faces): We have to make sure that face ID's are valid on all frames or no frames; make sure F has allocated faces for any face valid on the selected frame. diff -r 0b96c67ca1c5 -r 6fab7c7bb1f1 src/xfaces.c --- a/src/xfaces.c Sun May 30 17:28:33 1993 +0000 +++ b/src/xfaces.c Sun May 30 18:12:11 1993 +0000 @@ -90,7 +90,10 @@ vector). These are called "frame faces". Element 0 is the default face --- the one used for normal text. Element 1 is the modeline face. - These faces have their GC's set; the rest do not. (See src/xterm.h.) + These faces have their GC's set; the rest do not. + If faces[i] is filled in (i.e. non-zero) on one frame, then it must + be filled in on all frames. Code assumes that face ID's can be + used on any frame. (See src/xterm.h.) The global variables `face_vector' and `nfaces' define another array of struct face pointers, with their GC's set. This array @@ -457,6 +460,22 @@ ensure_face_ready (f, 1); recompute_basic_faces (f); + + /* Supposedly, we only apply this function to newly-created frames. */ + if (selected_frame == f) + abort (); + + /* Make sure that all faces valid on the selected frame are also valid + on this new frame. */ + { + int i; + int n_faces = selected_frame->display.x->n_faces; + struct face **faces = selected_frame->display.x->faces; + + for (i = 2; i < n_faces; i++) + if (faces[i]) + ensure_face_ready (f, i); + } }