aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorJim Blandy <[email protected]>1993-05-18 22:46:17 +0000
committerJim Blandy <[email protected]>1993-05-18 22:46:17 +0000
commita785758151de2f2aeb5ebecbf7375ffe862ffc1c (patch)
treee89caca3753e2056ac6fb074b16aa022b5ea81a2 /src/xfaces.c
parent3505ea701237ad94d57200cd4ba6bc768a8eef3d (diff)
* xfaces.c (free_frame_faces): Don't free the resources from the
first two faces.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c44
1 files changed, 6 insertions, 38 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index febafc8066..2339b57829 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -435,7 +435,7 @@ init_frame_faces (f)
face->gc = f->display.x->normal_gc;
face->foreground = gcv.foreground;
face->background = gcv.background;
- face->font = XQueryFont (x_current_display, gcv.font);
+ face->font = f->display.x->font;
face->stipple = 0;
face->underline = 0;
}
@@ -450,47 +450,12 @@ init_frame_faces (f)
face->gc = f->display.x->reverse_gc;
face->foreground = gcv.foreground;
face->background = gcv.background;
- face->font = XQueryFont (x_current_display, gcv.font);
+ face->font = f->display.x->font;
face->stipple = 0;
face->underline = 0;
}
}
-#if 0
-void
-init_frame_faces (f)
- struct frame *f;
-{
- struct frame *other_frame = 0;
- Lisp_Object rest;
-
- for (rest = Vframe_list; !NILP (rest); rest = Fcdr (rest))
- {
- struct frame *f2 = XFRAME (Fcar (rest));
- if (f2 != f && FRAME_X_P (f2))
- {
- other_frame = f2;
- break;
- }
- }
-
- if (other_frame)
- {
- /* Make sure this frame's face vector is as big as the others. */
- FRAME_N_FACES (f) = FRAME_N_FACES (other_frame);
- FRAME_FACES (f)
- = (struct face **) xmalloc (FRAME_N_FACES (f) * sizeof (struct face *));
-
- /* Make sure the frame has the two basic faces. */
- FRAME_DEFAULT_FACE (f)
- = copy_face (FRAME_DEFAULT_FACE (other_frame));
- FRAME_MODE_LINE_FACE (f)
- = copy_face (FRAME_MODE_LINE_FACE (other_frame));
- }
-}
-#endif
-
-
/* Called from Fdelete_frame. */
void
free_frame_faces (f)
@@ -499,7 +464,10 @@ free_frame_faces (f)
Display *dpy = x_current_display;
int i;
- for (i = 0; i < FRAME_N_FACES (f); i++)
+ /* The first two faces on the frame are just made of resources which
+ we borrowed from the frame's GC's, so don't free them. Let
+ them get freed by the x_destroy_window code. */
+ for (i = 2; i < FRAME_N_FACES (f); i++)
{
struct face *face = FRAME_FACES (f) [i];
if (! face)