From: Jason Rumney Date: Fri, 22 Dec 2000 11:33:37 +0000 (+0000) Subject: (w32_draw_bitmap): Fix drawing so it does not appear in the wrong colors X-Git-Tag: emacs-pretest-21.0.95~312 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9436cdf9a606ffcb470b86a1e3b39684a4e8b0d2;p=emacs.git (w32_draw_bitmap): Fix drawing so it does not appear in the wrong colors when the foreground is not black. (expose_window): Don't redraw the window that's currently being updated. --- diff --git a/src/ChangeLog b/src/ChangeLog index 75e6de5fd33..1d076114f9b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2000-12-22 Jason Rumney + + * w32term.c (w32_draw_bitmap): Fix drawing so it does not appear + in the wrong colors when the foreground is not black. + (expose_window): Don't redraw the window that's currently being + updated. + 2000-12-22 Gerd Moellmann * window.c (delete_window): Simplify somewhat. diff --git a/src/w32term.c b/src/w32term.c index c32b71ea1c2..ff56139315c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -792,7 +792,6 @@ w32_draw_bitmap (w, hdc, row, which) HDC compat_hdc; int x, y, wd, h, dy; HBITMAP pixmap; - HBRUSH fg_brush, orig_brush; HANDLE horig_obj; struct face *face; @@ -867,21 +866,14 @@ w32_draw_bitmap (w, hdc, row, which) compat_hdc = CreateCompatibleDC (hdc); SaveDC (hdc); - fg_brush = CreateSolidBrush (face->foreground); - orig_brush = SelectObject (hdc, fg_brush); + horig_obj = SelectObject (compat_hdc, pixmap); - SetTextColor (hdc, face->foreground); - SetBkColor (hdc, face->background); -#if 0 /* From w32bdf.c (which is from Meadow). */ - /* Old versions - in case we find a reason to fall back on them. */ + SetTextColor (hdc, face->background); + SetBkColor (hdc, face->foreground); + BitBlt (hdc, x, y + dy, wd, h, compat_hdc, 0, 0, SRCCOPY); - BitBlt (hdc, x, y + dy, wd, h, compat_hdc, 0, 0, 0xB8074A); -#else - BitBlt (hdc, x, y + dy, wd, h, compat_hdc, 0, 0, 0xE20746); -#endif + SelectObject (compat_hdc, horig_obj); - SelectObject (hdc, orig_brush); - DeleteObject (fg_brush); DeleteDC (compat_hdc); RestoreDC (hdc, -1); } @@ -3853,9 +3845,11 @@ x_draw_image_foreground (s) #if 0 /* From w32bdf.c (which is from Meadow). */ BitBlt (s->hdc, x, y, s->img->width, s->img->height, compat_hdc, 0, 0, SRCCOPY); -#else BitBlt (s->hdc, x, y, s->img->width, s->img->height, compat_hdc, 0, 0, 0xB8074A); +#else + BitBlt (s->hdc, x, y, s->img->width, s->img->height, + compat_hdc, 0, 0, 0xE20746); #endif SelectObject (s->hdc, orig_brush); DeleteObject (fg_brush); @@ -3998,9 +3992,11 @@ w32_draw_image_foreground_1 (s, pixmap) #if 0 /* From w32bdf.c (which is from Meadow). */ BitBlt (hdc, x, y, s->img->width, s->img->height, compat_hdc, 0, 0, SRCCOPY); -#else BitBlt (hdc, x, y, s->img->width, s->img->height, compat_hdc, 0, 0, 0xB8074A); +#else + BitBlt (hdc, x, y, s->img->width, s->img->height, + compat_hdc, 0, 0, 0xE20746); #endif SelectObject (hdc, orig_brush); DeleteObject (fg_brush); @@ -4154,9 +4150,11 @@ x_draw_image_glyph_string (s) #if 0 /* From w32bdf.c (which is from Meadow). */ BitBlt (s->hdc, s->x, s->y, s->background_width, s->height, compat_hdc, 0, 0, SRCCOPY); -#else BitBlt (s->hdc, s->x, s->y, s->background_width, s->height, compat_hdc, 0, 0, 0xB8074A); +#else + BitBlt (s->hdc, s->x, s->y, s->background_width, s->height, + compat_hdc, 0, 0, 0xE20746); #endif SelectObject (s->hdc, orig_brush); DeleteObject (fg_brush); @@ -5632,7 +5630,7 @@ expose_window (w, r) happen when toolkit scroll bars are used and a window is split. Reconfiguring the scroll bar will generate an expose for a newly created window. */ - if (w->current_matrix == NULL) + if (w->current_matrix == NULL || w == updated_window) return; TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n",