comparison src/xfaces.c @ 3299:6fab7c7bb1f1

* 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.
author Jim Blandy <jimb@redhat.com>
date Sun, 30 May 1993 18:12:11 +0000
parents 564f748751ea
children 836e5b3e6fe6
comparison
equal deleted inserted replaced
3298:0b96c67ca1c5 3299:6fab7c7bb1f1
88 accessors FRAME_FACES and FRAME_N_FACES), which define an array of 88 accessors FRAME_FACES and FRAME_N_FACES), which define an array of
89 struct face pointers, indexed by face ID (element 2 of the 89 struct face pointers, indexed by face ID (element 2 of the
90 vector). These are called "frame faces". 90 vector). These are called "frame faces".
91 Element 0 is the default face --- the one used for normal text. 91 Element 0 is the default face --- the one used for normal text.
92 Element 1 is the modeline face. 92 Element 1 is the modeline face.
93 These faces have their GC's set; the rest do not. (See src/xterm.h.) 93 These faces have their GC's set; the rest do not.
94 If faces[i] is filled in (i.e. non-zero) on one frame, then it must
95 be filled in on all frames. Code assumes that face ID's can be
96 used on any frame. (See src/xterm.h.)
94 97
95 The global variables `face_vector' and `nfaces' define another 98 The global variables `face_vector' and `nfaces' define another
96 array of struct face pointers, with their GC's set. This array 99 array of struct face pointers, with their GC's set. This array
97 acts as a cache of GC's to be used by all frames. The function 100 acts as a cache of GC's to be used by all frames. The function
98 `intern_face', passed a struct face *, searches face_vector for a 101 `intern_face', passed a struct face *, searches face_vector for a
455 { 458 {
456 ensure_face_ready (f, 0); 459 ensure_face_ready (f, 0);
457 ensure_face_ready (f, 1); 460 ensure_face_ready (f, 1);
458 461
459 recompute_basic_faces (f); 462 recompute_basic_faces (f);
463
464 /* Supposedly, we only apply this function to newly-created frames. */
465 if (selected_frame == f)
466 abort ();
467
468 /* Make sure that all faces valid on the selected frame are also valid
469 on this new frame. */
470 {
471 int i;
472 int n_faces = selected_frame->display.x->n_faces;
473 struct face **faces = selected_frame->display.x->faces;
474
475 for (i = 2; i < n_faces; i++)
476 if (faces[i])
477 ensure_face_ready (f, i);
478 }
460 } 479 }
461 480
462 481
463 /* Called from Fdelete_frame. */ 482 /* Called from Fdelete_frame. */
464 void 483 void