Commit 0c25f5ee authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Use better default values in create_screen_buffer.

parent f377ac1f
......@@ -3950,6 +3950,8 @@ static void test_AllocConsole(void)
static void test_pseudo_console_child(HANDLE input, HANDLE output)
{
CONSOLE_SCREEN_BUFFER_INFO sb_info;
CONSOLE_CURSOR_INFO cursor_info;
DWORD mode;
BOOL ret;
......@@ -3985,6 +3987,25 @@ static void test_pseudo_console_child(HANDLE input, HANDLE output)
ret = SetConsoleMode(output, mode | ENABLE_WRAP_AT_EOL_OUTPUT);
ok(ret, "SetConsoleMode failed: %u\n", GetLastError());
ret = GetConsoleScreenBufferInfo(output, &sb_info);
ok(ret, "GetConsoleScreenBufferInfo failed: %u\n", GetLastError());
ok(sb_info.dwSize.X == 40, "dwSize.X = %u\n", sb_info.dwSize.X);
ok(sb_info.dwSize.Y == 30, "dwSize.Y = %u\n", sb_info.dwSize.Y);
ok(sb_info.dwCursorPosition.X == 0, "dwCursorPosition.X = %u\n", sb_info.dwCursorPosition.X);
ok(sb_info.dwCursorPosition.Y == 0, "dwCursorPosition.Y = %u\n", sb_info.dwCursorPosition.Y);
ok(sb_info.wAttributes == 7, "wAttributes = %x\n", sb_info.wAttributes);
ok(sb_info.srWindow.Left == 0, "srWindow.Left = %u\n", sb_info.srWindow.Left);
ok(sb_info.srWindow.Top == 0, "srWindow.Top = %u\n", sb_info.srWindow.Top);
ok(sb_info.srWindow.Right == 39, "srWindow.Right = %u\n", sb_info.srWindow.Right);
ok(sb_info.srWindow.Bottom == 29, "srWindow.Bottom = %u\n", sb_info.srWindow.Bottom);
ok(sb_info.dwMaximumWindowSize.X == 40, "dwMaximumWindowSize.X = %u\n", sb_info.dwMaximumWindowSize.X);
ok(sb_info.dwMaximumWindowSize.Y == 30, "dwMaximumWindowSize.Y = %u\n", sb_info.dwMaximumWindowSize.Y);
ret = GetConsoleCursorInfo(output, &cursor_info);
ok(ret, "GetConsoleCursorInfo failed: %u\n", GetLastError());
ok(cursor_info.dwSize == 25, "dwSize = %u\n", cursor_info.dwSize);
ok(cursor_info.bVisible == TRUE, "bVisible = %x\n", cursor_info.bVisible);
test_console_title();
test_WriteConsoleInputW(input);
}
......
......@@ -184,19 +184,30 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int
screen_buffer->console = console;
screen_buffer->id = id;
screen_buffer->mode = ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT;
screen_buffer->cursor_size = 100;
screen_buffer->cursor_size = 25;
screen_buffer->cursor_visible = 1;
screen_buffer->width = width;
screen_buffer->height = height;
screen_buffer->attr = 0x07;
screen_buffer->popup_attr = 0xf5;
screen_buffer->max_width = 80;
screen_buffer->max_height = 25;
screen_buffer->win.right = min( screen_buffer->max_width - 1, width - 1 );
screen_buffer->win.bottom = min( screen_buffer->max_height - 1, height - 1);
screen_buffer->font.weight = FW_NORMAL;
screen_buffer->font.pitch_family = FIXED_PITCH | FF_DONTCARE;
if (console->active)
{
screen_buffer->max_width = console->active->max_width;
screen_buffer->max_height = console->active->max_height;
screen_buffer->win.right = console->active->win.right - console->active->win.left;
screen_buffer->win.bottom = console->active->win.bottom - console->active->win.top;
}
else
{
screen_buffer->max_width = width;
screen_buffer->max_height = height;
screen_buffer->win.right = width - 1;
screen_buffer->win.bottom = height - 1;
}
if (wine_rb_put( &screen_buffer_map, LongToPtr(id), &screen_buffer->entry ))
{
free( screen_buffer );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment