Hugh McMaster : conhost: Popup Attributes should match Character Attributes when creating a new screen buffer.

Alexandre Julliard julliard at winehq.org
Mon Jul 26 15:30:29 CDT 2021


Module: wine
Branch: master
Commit: f1023b4b52e8164e9fa774c62d282efcb399107b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f1023b4b52e8164e9fa774c62d282efcb399107b

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Jul 26 23:02:34 2021 +1000

conhost: Popup Attributes should match Character Attributes when creating a new screen buffer.

Popup Attributes should match Character Attributes when a new screen
buffer is created. The existing Popup Attributes are copied when
using a pseudo console.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/console.c | 12 ++++++------
 programs/conhost/conhost.c    |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 5f9342ffd44..6ee00aa49a6 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -1049,8 +1049,8 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
 
     ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: "
        "got %#x, expected %#x\n", csbi2.wAttributes, orig_attr);
-    todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
-    todo_wine ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n");
+    ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
+    ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n");
 
     /* Test different Character Attributes */
     attr = FOREGROUND_BLUE|BACKGROUND_GREEN;
@@ -1070,8 +1070,8 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
 
     ok(csbi2.wAttributes == attr, "Character Attributes should have been copied: "
        "got %#x, expected %#x\n", csbi2.wAttributes, attr);
-    todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
-    todo_wine ok(csbi2.wPopupAttributes == attr, "Popup Attributes should match Character Attributes\n");
+    ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
+    ok(csbi2.wPopupAttributes == attr, "Popup Attributes should match Character Attributes\n");
 
     ret = SetConsoleTextAttribute(hConOut, orig_attr);
     ok(ret, "SetConsoleTextAttribute failed: error %u\n", GetLastError());
@@ -1094,8 +1094,8 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
 
     ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: "
        "got %#x, expected %#x\n", csbi2.wAttributes, orig_attr);
-    todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
-    todo_wine ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n");
+    ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n");
+    ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n");
 
     csbi.wPopupAttributes = orig_popup;
     ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi);
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 805df880897..061f09989eb 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -85,7 +85,6 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
     screen_buffer->cursor_visible = 1;
     screen_buffer->width          = width;
     screen_buffer->height         = height;
-    screen_buffer->popup_attr     = 0xf5;
     screen_buffer->font.weight    = FW_NORMAL;
     screen_buffer->font.pitch_family = FIXED_PITCH | FF_DONTCARE;
 
@@ -96,6 +95,7 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
         screen_buffer->win.right  = console->active->win.right  - console->active->win.left;
         screen_buffer->win.bottom = console->active->win.bottom - console->active->win.top;
         screen_buffer->attr       = console->active->attr;
+        screen_buffer->popup_attr = console->active->attr;
     }
     else
     {
@@ -104,6 +104,7 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
         screen_buffer->win.right  = width - 1;
         screen_buffer->win.bottom = height - 1;
         screen_buffer->attr       = FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED;
+        screen_buffer->popup_attr = 0xf5;
     }
 
     if (wine_rb_put( &screen_buffer_map, LongToPtr(id), &screen_buffer->entry ))




More information about the wine-cvs mailing list