[PATCH 2/3] kernel32: Apply the new background colour to the active line

Hugh McMaster hugh.mcmaster at outlook.com
Mon Jan 25 04:01:01 CST 2016


Text typed after the background colour is changed still appears
with the old background colour, although the rest of the console
has already been given the new colour.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 dlls/kernel32/editline.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c
index 78ea789..b436a50 100644
--- a/dlls/kernel32/editline.c
+++ b/dlls/kernel32/editline.c
@@ -916,6 +916,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
     void		(*func)(struct WCEL_Context* ctx);
     DWORD               mode, input_mode, ks;
     int                 use_emacs;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
 
     memset(&ctx, 0, sizeof(ctx));
     ctx.hConIn = hConsoleIn;
@@ -994,6 +995,10 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
         if (ctx.insertkey)
             ctx.insert = !ctx.insert;
 
+        GetConsoleScreenBufferInfo(ctx.hConOut, &csbi);
+        if (ctx.csbi.wAttributes != csbi.wAttributes)
+            ctx.csbi.wAttributes = csbi.wAttributes;
+
 	if (func)
 	    (func)(&ctx);
 	else if (!(ir.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED))
-- 
1.9.1




More information about the wine-patches mailing list