diff options
| author | Eli Zaretskii | 2024-01-28 10:19:48 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-01-28 16:50:49 +0200 |
| commit | c22d0ae2dd899ebc1f74e4e67f098216899ea202 (patch) | |
| tree | 188d3da8228733c258adbb876e7bf6b55a95f973 /src | |
| parent | 396b49871aa5432e2ff00230868013a22b180656 (diff) | |
| download | emacs-c22d0ae2dd899ebc1f74e4e67f098216899ea202.tar.gz emacs-c22d0ae2dd899ebc1f74e4e67f098216899ea202.zip | |
Fix "emacs -nw" on MS-Windows
* src/w32term.c (w32_flip_buffers_if_dirty): Do nothing if F is
not a GUI frame. This avoids rare crashes in "emacs -nw".
* src/w32console.c (initialize_w32_display): Set the
ENABLE_EXTENDED_FLAGS bit in 'prev_console_mode'.
(cherry picked from commit e1970c99f097715fc5bb3b88154799bfe13de90f)
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32console.c | 4 | ||||
| -rw-r--r-- | src/w32term.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/w32console.c b/src/w32console.c index c2b87928cc1..0936b5f37e6 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -705,6 +705,10 @@ initialize_w32_display (struct terminal *term, int *width, int *height) | |||
| 705 | /* Remember original console settings. */ | 705 | /* Remember original console settings. */ |
| 706 | keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); | 706 | keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); |
| 707 | GetConsoleMode (keyboard_handle, &prev_console_mode); | 707 | GetConsoleMode (keyboard_handle, &prev_console_mode); |
| 708 | /* Make sure ENABLE_EXTENDED_FLAGS is set in console settings, | ||
| 709 | otherwise restoring the original setting of ENABLE_MOUSE_INPUT | ||
| 710 | will not work. */ | ||
| 711 | prev_console_mode |= ENABLE_EXTENDED_FLAGS; | ||
| 708 | 712 | ||
| 709 | prev_screen = GetStdHandle (STD_OUTPUT_HANDLE); | 713 | prev_screen = GetStdHandle (STD_OUTPUT_HANDLE); |
| 710 | 714 | ||
diff --git a/src/w32term.c b/src/w32term.c index 6dae118108e..281ce3c663a 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -776,12 +776,13 @@ w32_buffer_flipping_unblocked_hook (struct frame *f) | |||
| 776 | 776 | ||
| 777 | /* Flip buffers on F if drawing has happened. This function is not | 777 | /* Flip buffers on F if drawing has happened. This function is not |
| 778 | called to flush the display connection of a frame (which doesn't | 778 | called to flush the display connection of a frame (which doesn't |
| 779 | exist on MS Windows), but also called in some situations in | 779 | exist on MS Windows), but is called in some situations in |
| 780 | minibuf.c to make the contents of the back buffer visible. */ | 780 | minibuf.c to make the contents of the back buffer visible. */ |
| 781 | void | 781 | void |
| 782 | w32_flip_buffers_if_dirty (struct frame *f) | 782 | w32_flip_buffers_if_dirty (struct frame *f) |
| 783 | { | 783 | { |
| 784 | if (FRAME_OUTPUT_DATA (f)->paint_buffer | 784 | if (FRAME_W32_P (f) /* do nothing in TTY frames */ |
| 785 | && FRAME_OUTPUT_DATA (f)->paint_buffer | ||
| 785 | && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty | 786 | && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty |
| 786 | && !f->garbaged && !buffer_flipping_blocked_p ()) | 787 | && !f->garbaged && !buffer_flipping_blocked_p ()) |
| 787 | w32_show_back_buffer (f); | 788 | w32_show_back_buffer (f); |