diff options
author | Jim Blandy <[email protected]> | 1993-06-09 04:36:41 +0000 |
---|---|---|
committer | Jim Blandy <[email protected]> | 1993-06-09 04:36:41 +0000 |
commit | 1120eb5e8d7ed9b587bfdb91b221b70a9a552801 (patch) | |
tree | 75cc8a7c54b0ddfbb26d0c675206f7da948c31b8 /src/xfaces.c | |
parent | 4b5a51c1fe0108de6fdf8b13b0eb121b09c7e625 (diff) |
* xfaces.c (init_frame_faces): Remove assumption that the selected
frame must be an X frame whenever there is already an X frame.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r-- | src/xfaces.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 7a93111f57..41436ad4e4 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -465,22 +465,34 @@ init_frame_faces (f) recompute_basic_faces (f); - /* Supposedly, we only apply this function to newly-created frames. */ - if (selected_frame == f) - abort (); + /* Find another X frame. */ + { + Lisp_Object tail, frame, result; + + result = Qnil; + FOR_EACH_FRAME (tail, frame) + if (FRAME_X_P (XFRAME (frame)) + && XFRAME (frame) != f) + { + result = frame; + break; + } - /* Make sure that all faces valid on the selected frame are also valid - on this new frame. */ - if (FRAME_X_P (selected_frame)) - { - int i; - int n_faces = selected_frame->display.x->n_faces; - struct face **faces = selected_frame->display.x->faces; + /* If we didn't find any X frames other than f, then we don't need + any faces other than 0 and 1, so we're okay. Otherwise, make + sure that all faces valid on the selected frame are also valid + on this new frame. */ + if (FRAMEP (result)) + { + int i; + int n_faces = XFRAME (result)->display.x->n_faces; + struct face **faces = XFRAME (result)->display.x->faces; - for (i = 2; i < n_faces; i++) - if (faces[i]) - ensure_face_ready (f, i); - } + for (i = 2; i < n_faces; i++) + if (faces[i]) + ensure_face_ready (f, i); + } + } } |