Mercurial > emacs
changeset 14244:493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
ScrollConsoleScreenBuffer (which has a bug on Win95).
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Sun, 21 Jan 1996 00:28:26 +0000 |
parents | df4d211a0522 |
children | 59d24d42958a |
files | src/w32console.c |
diffstat | 1 files changed, 12 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/w32console.c Sun Jan 21 00:24:03 1996 +0000 +++ b/src/w32console.c Sun Jan 21 00:28:26 1996 +0000 @@ -123,25 +123,18 @@ void clear_frame (void) { - SMALL_RECT scroll; + FRAME_PTR f = PICK_FRAME (); COORD dest; - CHAR_INFO fill; - FRAME_PTR f = PICK_FRAME (); - + int n, r; + hl_mode (0); - scroll.Top = 0; - scroll.Bottom = FRAME_HEIGHT (f) - 1; - scroll.Left = 0; - scroll.Right = FRAME_WIDTH (f) - 1; - - dest.Y = FRAME_HEIGHT (f); - dest.X = 0; - - fill.Char.AsciiChar = 0x20; - fill.Attributes = char_attr; - - ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); + n = FRAME_HEIGHT (f) * FRAME_WIDTH (f); + dest.X = dest.Y = 0; + + FillConsoleOutputAttribute (cur_screen, char_attr, n, dest, &r); + FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); + move_cursor (0, 0); } @@ -347,6 +340,9 @@ char *chars; int i; + if (len <= 0) + return; + attrs = alloca (len * sizeof (*attrs)); chars = alloca (len * sizeof (*chars)); if (attrs == NULL || chars == NULL)