changeset 51665:c1f65dfc56eb

Fix some of the font/face problems.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 26 Jun 2003 21:18:45 +0000
parents 2d18e453554f
children 7181f5ced81c
files src/ChangeLog src/frame.c src/frame.h src/xfaces.c
diffstat 4 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jun 26 21:09:11 2003 +0000
+++ b/src/ChangeLog	Thu Jun 26 21:18:45 2003 +0000
@@ -1,5 +1,14 @@
 2003-06-26  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
+	* xfaces.c (set_font_frame_param): Set default_face_done_p to zero.
+	(realize_default_face): Use default_face_done_p for the force_p
+	argument to set_lface_from_font_name.  Set default_face_done_p to
+	one.
+
+	* frame.c (make_frame): Initialize default_face_done_p.
+
+	* frame.h (struct frame): Add default_face_done_p.
+
 	* config.in: Add XRegisterIMInstantiateCallback_arg6 so it
 	will be defined.
 
--- a/src/frame.c	Thu Jun 26 21:09:11 2003 +0000
+++ b/src/frame.c	Thu Jun 26 21:18:45 2003 +0000
@@ -372,6 +372,8 @@
      a newly-created, never-selected window.  */
   XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
 
+  f->default_face_done_p = 0;
+
   return f;
 }
 
--- a/src/frame.h	Thu Jun 26 21:09:11 2003 +0000
+++ b/src/frame.h	Thu Jun 26 21:18:45 2003 +0000
@@ -451,6 +451,11 @@
   /* Set to non-zero in change_frame_size when size of frame changed
      Clear the frame in clear_garbaged_frames if set.  */
   unsigned resized_p : 1;
+
+  /* Set to non-zero if the default face for the frame has been
+     realized.  Reset to zero whenever the default face changes.
+     Used to see the difference between a font change and face change.  */
+  unsigned default_face_done_p : 1;
 };
 
 #ifdef MULTI_KBOARD
--- a/src/xfaces.c	Thu Jun 26 21:09:11 2003 +0000
+++ b/src/xfaces.c	Thu Jun 26 21:18:45 2003 +0000
@@ -4340,6 +4340,7 @@
 	  xfree (font);
 	}
 
+      f->default_face_done_p = 0;
       Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil));
     }
 }
@@ -6586,9 +6587,9 @@
       frame_font = Fassq (Qfont, f->param_alist);
       xassert (CONSP (frame_font) && STRINGP (XCDR (frame_font)));
       frame_font = XCDR (frame_font);
-      /* Specify 0 for FORCE_P here, so that we don't override
-	 a :family attribute specified for `default' for new frames.  */
-      set_lface_from_font_name (f, lface, frame_font, 0, 1);
+      set_lface_from_font_name (f, lface, frame_font,
+                                f->default_face_done_p, 1);
+      f->default_face_done_p = 1;
     }
 #endif /* HAVE_WINDOW_SYSTEM */