]> git.eshelyaron.com Git - emacs.git/commitdiff
(dumpglyphs): Check the case that FACE_FONT (face) is
authorKenichi Handa <handa@m17n.org>
Sat, 20 Jun 1998 03:01:00 +0000 (03:01 +0000)
committerKenichi Handa <handa@m17n.org>
Sat, 20 Jun 1998 03:01:00 +0000 (03:01 +0000)
NULL.  While displaing cursor with non-default face, if the
variable `font' is NULL, don't set GCFont.

src/xterm.c

index 565e9205ca7d3fbf3b7593ece3b4990c4b8355f2..582eb2fd5fb31bc965b45b4db9bba79b4ae25931 100644 (file)
@@ -783,7 +783,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp)
            if (charset == CHARSET_ASCII || charset == charset_latin_iso8859_1)
              {
                font = FACE_FONT (face);
-               if (font == (XFontStruct *) FACE_DEFAULT)
+               if (!font || font == (XFontStruct *) FACE_DEFAULT)
                  font = f->output_data.x->font;
                baseline = FONT_BASE (f->output_data.x->font);
                if (charset == charset_latin_iso8859_1)
@@ -837,12 +837,14 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp)
                    xgcv.background = face->foreground;
                    xgcv.foreground = face->background;
                  }
-               if (font)
-                 xgcv.font = font->fid;
-               else
-                 xgcv.font = FACE_FONT (face)->fid;
                xgcv.graphics_exposures = 0;
-               mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+               mask = GCForeground | GCBackground | GCGraphicsExposures;
+               if (font)
+                 {
+                   xgcv.font = font->fid;
+                   mask |= GCFont;
+                 }
+
                if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc)
                  XChangeGC (FRAME_X_DISPLAY (f),
                             FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,