conhost: Improve notification when resizing window.

Signed-off-by: Roman Pišl <rpisl@seznam.cz>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 2ca86d3b59)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Roman Pišl 2021-02-01 18:29:16 +01:00 committed by Michael Stefaniuc
parent 9dff1027d5
commit 88a189f964
3 changed files with 17 additions and 8 deletions

View File

@ -1735,6 +1735,18 @@ static NTSTATUS get_output_info( struct screen_buffer *screen_buffer, size_t *ou
return STATUS_SUCCESS;
}
void notify_screen_buffer_size( struct screen_buffer *screen_buffer )
{
if (is_active( screen_buffer ) && screen_buffer->console->mode & ENABLE_WINDOW_INPUT)
{
INPUT_RECORD ir;
ir.EventType = WINDOW_BUFFER_SIZE_EVENT;
ir.Event.WindowBufferSizeEvent.dwSize.X = screen_buffer->width;
ir.Event.WindowBufferSizeEvent.dwSize.Y = screen_buffer->height;
write_console_input( screen_buffer->console, &ir, 1, TRUE );
}
}
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height )
{
int i, old_width, old_height, copy_width, copy_height;
@ -1839,14 +1851,7 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
if (screen_buffer->cursor_x >= info->width) screen_buffer->cursor_x = info->width - 1;
if (screen_buffer->cursor_y >= info->height) screen_buffer->cursor_y = info->height - 1;
if (is_active( screen_buffer ) && screen_buffer->console->mode & ENABLE_WINDOW_INPUT)
{
INPUT_RECORD ir;
ir.EventType = WINDOW_BUFFER_SIZE_EVENT;
ir.Event.WindowBufferSizeEvent.dwSize.X = info->width;
ir.Event.WindowBufferSizeEvent.dwSize.Y = info->height;
write_console_input( screen_buffer->console, &ir, 1, TRUE );
}
notify_screen_buffer_size( screen_buffer );
}
if (params->mask & SET_CONSOLE_OUTPUT_INFO_ATTR)
{

View File

@ -136,6 +136,8 @@ void update_window_config( struct console *console );
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
unsigned int count, BOOL flush );
void notify_screen_buffer_size( struct screen_buffer *screen_buffer );
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )

View File

@ -1901,6 +1901,8 @@ static void apply_config( struct console *console, const struct console_config *
}
update_window( console );
notify_screen_buffer_size( console->active );
}
static void current_config( struct console *console, struct console_config *config )