# HG changeset patch # User Andrew Innes # Date 927394681 0 # Node ID 4582b492a6510d068a4dce5ec41355ed0f427b4c # Parent 3bb855a40bf65ff615974e3c63f8ea31bbb4ab88 (maybe_generate_resize_event): Detect changes in the console window size. (w32_console_read_socket): Call maybe_generate_resize_event whenever input events are received, since we don't get told when the window size changes (as opposed to the buffer size, which we don't care about). diff -r 3bb855a40bf6 -r 4582b492a651 src/w32inevt.c --- a/src/w32inevt.c Sat May 22 17:37:18 1999 +0000 +++ b/src/w32inevt.c Sat May 22 17:38:01 1999 +0000 @@ -620,6 +620,22 @@ SET_FRAME_GARBAGED (f); } +static void +maybe_generate_resize_event () +{ + CONSOLE_SCREEN_BUFFER_INFO info; + FRAME_PTR f = get_frame (); + + GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); + + /* It is okay to call this unconditionally, since it will do nothing + if the size hasn't actually changed. */ + change_frame_size (f, + 1 + info.srWindow.Bottom - info.srWindow.Top, + 1 + info.srWindow.Right - info.srWindow.Left, + 0, 0); +} + int w32_console_read_socket (int sd, struct input_event *bufp, int numchars, int expected) @@ -672,9 +688,11 @@ numchars -= add; break; +#if 0 case WINDOW_BUFFER_SIZE_EVENT: resize_event (&queue_ptr->Event.WindowBufferSizeEvent); break; +#endif case MENU_EVENT: case FOCUS_EVENT: @@ -689,7 +707,12 @@ if (ret > 0 || expected == 0) break; } - + + /* We don't get told about changes in the window size (only the buffer + size, which we no longer care about), so we have to check it + periodically. */ + maybe_generate_resize_event (); + UNBLOCK_INPUT; return ret; }