]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure cursor's foreground color is in sync with 'default' face
authorEli Zaretskii <eliz@gnu.org>
Wed, 10 May 2017 17:06:15 +0000 (20:06 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 10 May 2017 17:06:15 +0000 (20:06 +0300)
* src/w32term.c (x_set_cursor_gc): Don't reuse cursor GC if its
foreground color is different from the background of the glyph
string's face.  (Bug#26851)

src/w32term.c

index 0f9dce9190ceb73a9c98d2c2e4b6dc6aecdc4c62..712bdae5fc3baf0122750b55d84be20f7425b0f3 100644 (file)
@@ -954,6 +954,10 @@ x_set_cursor_gc (struct glyph_string *s)
   if (s->font == FRAME_FONT (s->f)
       && s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
       && s->face->foreground == FRAME_FOREGROUND_PIXEL (s->f)
+      /* Sometimes we are not called for each change in the default
+        face's background color (e.g., bug#26851), so the additional
+        test in the next line gives us a chance to resync.  */
+      && s->f->output_data.w32->cursor_gc->foreground == s->face->background
       && !s->cmp)
     s->gc = s->f->output_data.w32->cursor_gc;
   else