diff options
author | Andrew Innes <andrewi@gnu.org> | 1999-05-22 17:38:01 +0000 |
---|---|---|
committer | Andrew Innes <andrewi@gnu.org> | 1999-05-22 17:38:01 +0000 |
commit | 09344a1cbf9ae0f914936f976b74d4022c02b462 (patch) | |
tree | 7acb6f6628a7d8d4c31e4184cda4de29c629de2b /src/w32inevt.c | |
parent | 06a0eca1502de1fc9856d82934daf769cf205f50 (diff) | |
download | emacs-09344a1cbf9ae0f914936f976b74d4022c02b462.tar.gz |
(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).
Diffstat (limited to 'src/w32inevt.c')
-rw-r--r-- | src/w32inevt.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/w32inevt.c b/src/w32inevt.c index ce20bd452d8..2a2cf63b17e 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -620,6 +620,22 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event) 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 @@ w32_console_read_socket (int sd, struct input_event *bufp, int numchars, 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 @@ w32_console_read_socket (int sd, struct input_event *bufp, int numchars, 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; } |