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>
This commit is contained in:
parent
3657c8b829
commit
2ca86d3b59
|
@ -1735,6 +1735,18 @@ static NTSTATUS get_output_info( struct screen_buffer *screen_buffer, size_t *ou
|
||||||
return STATUS_SUCCESS;
|
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 )
|
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;
|
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_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 (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)
|
notify_screen_buffer_size( screen_buffer );
|
||||||
{
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (params->mask & SET_CONSOLE_OUTPUT_INFO_ATTR)
|
if (params->mask & SET_CONSOLE_OUTPUT_INFO_ATTR)
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,6 +136,8 @@ void update_window_config( struct console *console );
|
||||||
|
|
||||||
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
|
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
|
||||||
unsigned int count, BOOL flush );
|
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 );
|
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 )
|
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
|
||||||
|
|
|
@ -1901,6 +1901,8 @@ static void apply_config( struct console *console, const struct console_config *
|
||||||
}
|
}
|
||||||
|
|
||||||
update_window( console );
|
update_window( console );
|
||||||
|
|
||||||
|
notify_screen_buffer_size( console->active );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void current_config( struct console *console, struct console_config *config )
|
static void current_config( struct console *console, struct console_config *config )
|
||||||
|
|
Loading…
Reference in New Issue