aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-06-09 04:36:41 +0000
committerJim Blandy1993-06-09 04:36:41 +0000
commit1120eb5e8d7ed9b587bfdb91b221b70a9a552801 (patch)
tree75cc8a7c54b0ddfbb26d0c675206f7da948c31b8
parent4b5a51c1fe0108de6fdf8b13b0eb121b09c7e625 (diff)
downloademacs-1120eb5e8d7ed9b587bfdb91b221b70a9a552801.tar.gz
emacs-1120eb5e8d7ed9b587bfdb91b221b70a9a552801.zip
* xfaces.c (init_frame_faces): Remove assumption that the selected
frame must be an X frame whenever there is already an X frame.
-rw-r--r--src/xfaces.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 7a93111f57d..41436ad4e40 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -465,22 +465,34 @@ init_frame_faces (f)
465 465
466 recompute_basic_faces (f); 466 recompute_basic_faces (f);
467 467
468 /* Supposedly, we only apply this function to newly-created frames. */ 468 /* Find another X frame. */
469 if (selected_frame == f) 469 {
470 abort (); 470 Lisp_Object tail, frame, result;
471
472 result = Qnil;
473 FOR_EACH_FRAME (tail, frame)
474 if (FRAME_X_P (XFRAME (frame))
475 && XFRAME (frame) != f)
476 {
477 result = frame;
478 break;
479 }
471 480
472 /* Make sure that all faces valid on the selected frame are also valid 481 /* If we didn't find any X frames other than f, then we don't need
473 on this new frame. */ 482 any faces other than 0 and 1, so we're okay. Otherwise, make
474 if (FRAME_X_P (selected_frame)) 483 sure that all faces valid on the selected frame are also valid
475 { 484 on this new frame. */
476 int i; 485 if (FRAMEP (result))
477 int n_faces = selected_frame->display.x->n_faces; 486 {
478 struct face **faces = selected_frame->display.x->faces; 487 int i;
488 int n_faces = XFRAME (result)->display.x->n_faces;
489 struct face **faces = XFRAME (result)->display.x->faces;
479 490
480 for (i = 2; i < n_faces; i++) 491 for (i = 2; i < n_faces; i++)
481 if (faces[i]) 492 if (faces[i])
482 ensure_face_ready (f, i); 493 ensure_face_ready (f, i);
483 } 494 }
495 }
484} 496}
485 497
486 498