diff options
| author | Jim Blandy | 1993-05-18 22:46:17 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-18 22:46:17 +0000 |
| commit | a785758151de2f2aeb5ebecbf7375ffe862ffc1c (patch) | |
| tree | e89caca3753e2056ac6fb074b16aa022b5ea81a2 /src/xfaces.c | |
| parent | 3505ea701237ad94d57200cd4ba6bc768a8eef3d (diff) | |
| download | emacs-a785758151de2f2aeb5ebecbf7375ffe862ffc1c.tar.gz emacs-a785758151de2f2aeb5ebecbf7375ffe862ffc1c.zip | |
* 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.c | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index febafc8066a..2339b578299 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -435,7 +435,7 @@ init_frame_faces (f) | |||
| 435 | face->gc = f->display.x->normal_gc; | 435 | face->gc = f->display.x->normal_gc; |
| 436 | face->foreground = gcv.foreground; | 436 | face->foreground = gcv.foreground; |
| 437 | face->background = gcv.background; | 437 | face->background = gcv.background; |
| 438 | face->font = XQueryFont (x_current_display, gcv.font); | 438 | face->font = f->display.x->font; |
| 439 | face->stipple = 0; | 439 | face->stipple = 0; |
| 440 | face->underline = 0; | 440 | face->underline = 0; |
| 441 | } | 441 | } |
| @@ -450,47 +450,12 @@ init_frame_faces (f) | |||
| 450 | face->gc = f->display.x->reverse_gc; | 450 | face->gc = f->display.x->reverse_gc; |
| 451 | face->foreground = gcv.foreground; | 451 | face->foreground = gcv.foreground; |
| 452 | face->background = gcv.background; | 452 | face->background = gcv.background; |
| 453 | face->font = XQueryFont (x_current_display, gcv.font); | 453 | face->font = f->display.x->font; |
| 454 | face->stipple = 0; | 454 | face->stipple = 0; |
| 455 | face->underline = 0; | 455 | face->underline = 0; |
| 456 | } | 456 | } |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | #if 0 | ||
| 460 | void | ||
| 461 | init_frame_faces (f) | ||
| 462 | struct frame *f; | ||
| 463 | { | ||
| 464 | struct frame *other_frame = 0; | ||
| 465 | Lisp_Object rest; | ||
| 466 | |||
| 467 | for (rest = Vframe_list; !NILP (rest); rest = Fcdr (rest)) | ||
| 468 | { | ||
| 469 | struct frame *f2 = XFRAME (Fcar (rest)); | ||
| 470 | if (f2 != f && FRAME_X_P (f2)) | ||
| 471 | { | ||
| 472 | other_frame = f2; | ||
| 473 | break; | ||
| 474 | } | ||
| 475 | } | ||
| 476 | |||
| 477 | if (other_frame) | ||
| 478 | { | ||
| 479 | /* Make sure this frame's face vector is as big as the others. */ | ||
| 480 | FRAME_N_FACES (f) = FRAME_N_FACES (other_frame); | ||
| 481 | FRAME_FACES (f) | ||
| 482 | = (struct face **) xmalloc (FRAME_N_FACES (f) * sizeof (struct face *)); | ||
| 483 | |||
| 484 | /* Make sure the frame has the two basic faces. */ | ||
| 485 | FRAME_DEFAULT_FACE (f) | ||
| 486 | = copy_face (FRAME_DEFAULT_FACE (other_frame)); | ||
| 487 | FRAME_MODE_LINE_FACE (f) | ||
| 488 | = copy_face (FRAME_MODE_LINE_FACE (other_frame)); | ||
| 489 | } | ||
| 490 | } | ||
| 491 | #endif | ||
| 492 | |||
| 493 | |||
| 494 | /* Called from Fdelete_frame. */ | 459 | /* Called from Fdelete_frame. */ |
| 495 | void | 460 | void |
| 496 | free_frame_faces (f) | 461 | free_frame_faces (f) |
| @@ -499,7 +464,10 @@ free_frame_faces (f) | |||
| 499 | Display *dpy = x_current_display; | 464 | Display *dpy = x_current_display; |
| 500 | int i; | 465 | int i; |
| 501 | 466 | ||
| 502 | for (i = 0; i < FRAME_N_FACES (f); i++) | 467 | /* The first two faces on the frame are just made of resources which |
| 468 | we borrowed from the frame's GC's, so don't free them. Let | ||
| 469 | them get freed by the x_destroy_window code. */ | ||
| 470 | for (i = 2; i < FRAME_N_FACES (f); i++) | ||
| 503 | { | 471 | { |
| 504 | struct face *face = FRAME_FACES (f) [i]; | 472 | struct face *face = FRAME_FACES (f) [i]; |
| 505 | if (! face) | 473 | if (! face) |