Author: weiden
Date: Sun Oct 21 02:26:58 2007
New Revision: 29723
URL:
http://svn.reactos.org/svn/reactos?rev=29723&view=rev
Log:
Fixes updating default character attributes when calling SetConsoleTextAttribute().
See issue #2705 for more details.
Modified:
trunk/reactos/subsystems/win32/csrss/include/conio.h
trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c
Modified: trunk/reactos/subsystems/win32/csrss/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/include/conio.h (original)
+++ trunk/reactos/subsystems/win32/csrss/include/conio.h Sun Oct 21 02:26:58 2007
@@ -56,6 +56,7 @@
BOOL (STDCALL *SetCursorInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER
ScreenBuffer);
BOOL (STDCALL *SetScreenInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER
ScreenBuffer,
UINT OldCursorX, UINT OldCursorY);
+ BOOL (STDCALL *UpdateScreenInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER
ScreenBuffer);
BOOL (STDCALL *ChangeTitle)(PCSRSS_CONSOLE Console);
VOID (STDCALL *CleanupConsole)(PCSRSS_CONSOLE Console);
BOOL (STDCALL *ChangeIcon)(PCSRSS_CONSOLE Console);
@@ -152,6 +153,8 @@
#define ConioSetCursorInfo(Console, Buff) (Console)->Vtbl->SetCursorInfo((Console),
(Buff))
#define ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY) \
(Console)->Vtbl->SetScreenInfo((Console), (Buff), (OldCursorX),
(OldCursorY))
+#define ConioUpdateScreenInfo(Console, Buff) \
+ (Console)->Vtbl->UpdateScreenInfo(Console, Buff)
#define ConioChangeTitle(Console) (Console)->Vtbl->ChangeTitle(Console)
#define ConioCleanupConsole(Console) (Console)->Vtbl->CleanupConsole(Console)
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c Sun Oct 21 02:26:58 2007
@@ -2049,7 +2049,6 @@
NTSTATUS Status;
PCSRSS_CONSOLE Console;
PCSRSS_SCREEN_BUFFER Buff;
- LONG OldCursorX, OldCursorY;
DPRINT("CsrSetTextAttrib\n");
@@ -2068,13 +2067,11 @@
}
return Request->Status = Status;
}
-
- ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &OldCursorX,
&OldCursorY);
Buff->DefaultAttrib = Request->Data.SetAttribRequest.Attrib;
if (NULL != Console && Buff == Console->ActiveBuffer)
{
- if (! ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY))
+ if (! ConioUpdateScreenInfo(Console, Buff))
{
ConioUnlockScreenBuffer(Buff);
ConioUnlockConsole(Console);
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c Sun Oct 21 02:26:58 2007
@@ -1244,6 +1244,20 @@
}
return TRUE;
+}
+
+static BOOL STDCALL
+GuiUpdateScreenInfo(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff)
+{
+ PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA) Console->PrivateData;
+
+ if (Console->ActiveBuffer == Buff)
+ {
+ GuiData->ScreenText = GuiConsoleRGBFromAttribute(Buff->DefaultAttrib &
0x0f);
+ GuiData->ScreenBackground = GuiConsoleRGBFromAttribute((Buff->DefaultAttrib
& 0xf0) >> 4);
+ }
+
+ return TRUE;
}
static VOID FASTCALL
@@ -2124,6 +2138,7 @@
GuiDrawRegion,
GuiSetCursorInfo,
GuiSetScreenInfo,
+ GuiUpdateScreenInfo,
GuiChangeTitle,
GuiCleanupConsole,
GuiChangeIcon
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c Sun Oct 21 02:26:58 2007
@@ -211,6 +211,12 @@
}
return TRUE;
+}
+
+static BOOL STDCALL
+TuiUpdateScreenInfo(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff)
+{
+ return TRUE;
}
static BOOL STDCALL
@@ -293,6 +299,7 @@
TuiDrawRegion,
TuiSetCursorInfo,
TuiSetScreenInfo,
+ TuiUpdateScreenInfo,
TuiChangeTitle,
TuiCleanupConsole
};