https://git.reactos.org/?p=reactos.git;a=commitdiff;h=434fa562cec395fdda203…
commit 434fa562cec395fdda203f78f3682958663c1e3b
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Oct 2 00:11:32 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Oct 2 00:20:21 2020 +0200
[USETUP] Do a trick to avoid visual "blinking" during screen clearing.
(#3255)
CORE-17312
Hide everything under the same foreground & background colors, so that
the actual color and text blanking reset does not create a visual
"blinking".
Then, blank the text and finally reset the actual foreground &
background colors.
We do this because we cannot do the screen scrolling trick that would
allow to change both the text and the colors at the same time (the
function is currently not available in our console "emulation" layer).
---
base/setup/usetup/consup.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/base/setup/usetup/consup.c b/base/setup/usetup/consup.c
index 59e39ea2d7b..2a5336cb5e5 100644
--- a/base/setup/usetup/consup.c
+++ b/base/setup/usetup/consup.c
@@ -235,17 +235,32 @@ CONSOLE_ClearScreen(VOID)
coPos.X = 0;
coPos.Y = 0;
+ /*
+ * Hide everything under the same foreground & background colors, so that
+ * the actual color and text blanking reset does not create a visual
"blinking".
+ * We do this because we cannot do the screen scrolling trick that would
+ * allow to change both the text and the colors at the same time (the
+ * function is currently not available in our console "emulation" layer).
+ */
FillConsoleOutputAttribute(StdOutput,
- FOREGROUND_WHITE | BACKGROUND_BLUE,
+ FOREGROUND_BLUE | BACKGROUND_BLUE,
xScreen * yScreen,
coPos,
&Written);
+ /* Blank the text */
FillConsoleOutputCharacterA(StdOutput,
' ',
xScreen * yScreen,
coPos,
&Written);
+
+ /* Reset the actual foreground & background colors */
+ FillConsoleOutputAttribute(StdOutput,
+ FOREGROUND_WHITE | BACKGROUND_BLUE,
+ xScreen * yScreen,
+ coPos,
+ &Written);
}
VOID