giacomo boffi <giacomo.boffi(a)polimi.it> wrote:
i reverted Didier's patch, and VM is OK again
OK. Now try this one _on top_ of the other, and tell me if it works
correctly.
Index: faces.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/faces.c,v
retrieving revision 1.25.2.18
diff -u -r1.25.2.18 faces.c
--- faces.c 2000/11/20 14:02:17 1.25.2.18
+++ faces.c 2000/11/23 15:06:16
@@ -1154,22 +1154,6 @@
}
}
-/* Called when the updated flag has been cleared on a cachel. */
-
-void
-update_face_cachel_data (struct face_cachel *cachel,
- Lisp_Object domain,
- Lisp_Object face)
-{
- if (XFACE (face)->dirty || UNBOUNDP (cachel->face))
- {
- int default_face = EQ (face, Vdefault_face);
- cachel->face = face;
-
- /* We normally only set the _specified flags if the value was
- actually bound. The exception is for the default face where
- we always set it since it is the ultimate fallback. */
-
#define FROB(field) \
do { \
Lisp_Object new_val = \
@@ -1188,6 +1172,76 @@
cachel->field##_specified = (bound || default_face); \
} while (0)
+/*
+ * A face's background pixmap will override the face's
+ * background color. But the background pixmap of the
+ * default face should not override the background color of
+ * a face if the background color has been specified or
+ * inherited.
+ *
+ * To accomplish this we remove the background pixmap of the
+ * cachel and mark it as having been specified so that cachel
+ * merging won't override it later.
+ */
+#define MAYBE_UNFROB_BACKGROUND_PIXMAP \
+do \
+{ \
+ if (! default_face \
+ && cachel->background_specified \
+ && ! cachel->background_pixmap_specified) \
+ { \
+ cachel->background_pixmap = Qunbound; \
+ cachel->background_pixmap_specified = 1; \
+ } \
+} while (0)
+
+
+/* Add a cachel for the given face to the given window's cache. */
+
+static void
+add_face_cachel (struct window *w, Lisp_Object face)
+{
+ int must_finish_frobbing = ! WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
+ struct face_cachel new_cachel;
+ Lisp_Object domain;
+
+ reset_face_cachel (&new_cachel);
+ XSETWINDOW (domain, w);
+ update_face_cachel_data (&new_cachel, domain, face);
+ Dynarr_add (w->face_cachels, new_cachel);
+
+ /* The face's background pixmap have not yet been frobbed (see comment
+ int update_face_cachel_data), so we have to do it now */
+ if (must_finish_frobbing)
+ {
+ int default_face = EQ (face, Vdefault_face);
+ struct face_cachel *cachel
+ = Dynarr_atp (w->face_cachels, Dynarr_length (w->face_cachels) - 1);
+
+ FROB (background_pixmap);
+ MAYBE_UNFROB_BACKGROUND_PIXMAP;
+ }
+}
+
+/* Called when the updated flag has been cleared on a cachel.
+ This function returns 1 if the caller must finish the update (see comment
+ below), 0 otherwise.
+*/
+
+void
+update_face_cachel_data (struct face_cachel *cachel,
+ Lisp_Object domain,
+ Lisp_Object face)
+{
+ if (XFACE (face)->dirty || UNBOUNDP (cachel->face))
+ {
+ int default_face = EQ (face, Vdefault_face);
+ cachel->face = face;
+
+ /* We normally only set the _specified flags if the value was
+ actually bound. The exception is for the default face where
+ we always set it since it is the ultimate fallback. */
+
FROB (foreground);
FROB (background);
FROB (display_table);
@@ -1220,44 +1274,23 @@
other image-related face attributes are ever implemented, they should
be protected the same way right here.
- Some notes:
+ One note:
* See comment in `default_face_font_info' in face.c. Who wrote it ?
Maybe we have the begining of an answer here ?
- * After window initialization, we end up with an incomplete cache
- since the background pixmap has not been frobbed. It seems however
- that redisplay will correct the situation the next time it is
- triggered. Is that correct ? All the time ?
Footnotes:
[1] See comment at the top of `allocate_window' in window.c.
-- didier
*/
- if (!WINDOWP (domain)
+ if (! WINDOWP (domain)
|| WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), DEFAULT_INDEX))
{
FROB (background_pixmap);
-
- /*
- * A face's background pixmap will override the face's
- * background color. But the background pixmap of the
- * default face should not override the background color of
- * a face if the background color has been specified or
- * inherited.
- *
- * To accomplish this we remove the background pixmap of the
- * cachel and mark it as having been specified so that cachel
- * merging won't override it later.
- */
- if (! default_face
- && cachel->background_specified
- && ! cachel->background_pixmap_specified)
- {
- cachel->background_pixmap = Qunbound;
- cachel->background_pixmap_specified = 1;
- }
+ MAYBE_UNFROB_BACKGROUND_PIXMAP;
}
#undef FROB
+#undef MAYBE_UNFROB_BACKGROUND_PIXMAP
ensure_face_cachel_contains_charset (cachel, domain, Vcharset_ascii);
@@ -1360,20 +1393,6 @@
}
cachel->display_table = Qunbound;
cachel->background_pixmap = Qunbound;
-}
-
-/* Add a cachel for the given face to the given window's cache. */
-
-static void
-add_face_cachel (struct window *w, Lisp_Object face)
-{
- struct face_cachel new_cachel;
- Lisp_Object window;
-
- reset_face_cachel (&new_cachel);
- XSETWINDOW (window, w);
- update_face_cachel_data (&new_cachel, window, face);
- Dynarr_add (w->face_cachels, new_cachel);
}
/* Retrieve the index to a cachel for window W that corresponds to
--
/ / _ _ Didier Verna
http://www.inf.enst.fr/~verna/
- / / - / / /_/ / EPITA / LRDE mailto:didier@lrde.epita.fr
/_/ / /_/ / /__ / 14-16 rue Voltaire Tel. +33 (1) 53 14 59 47
94276 Kremlin-Bicêtre cedex Fax. +33 (1) 44 08 01 99