From 56a47981cc921369dd124cc023ca1469225b1fa7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 20 Nov 2016 19:28:37 +0200 Subject: [PATCH] Fix redrawing non-selected frame after resize on MS-Windows * src/xdisp.c (redisplay_internal): If all the frames were successfully updated, reset the "garbaged" flag of each frame, to make sure it doesn't stay set. * src/w32term.c (w32_read_socket): Don't clear the frame if it's "garbaged", since expose_frame won't redraw the foreground then. (Bug#24642) --- src/w32term.c | 15 +++++++++++---- src/xdisp.c | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index e8d66c9e5a1..ae0f741f24c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4628,11 +4628,18 @@ w32_read_socket (struct terminal *terminal, } else { - HDC hdc = get_frame_dc (f); + /* Erase background again for safety. But don't do + that if the frame's 'garbaged' flag is set, since + in that case expose_frame will do nothing, and if + the various redisplay flags happen to be unset, + we are left with a blank frame. */ + if (!FRAME_GARBAGED_P (f)) + { + HDC hdc = get_frame_dc (f); - /* Erase background again for safety. */ - w32_clear_rect (f, hdc, &msg.rect); - release_frame_dc (f, hdc); + w32_clear_rect (f, hdc, &msg.rect); + release_frame_dc (f, hdc); + } expose_frame (f, msg.rect.left, msg.rect.top, diff --git a/src/xdisp.c b/src/xdisp.c index c045ced000b..1420a4a7e36 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14116,6 +14116,7 @@ redisplay_internal (void) if (f->updated_p) { f->redisplay = false; + f->garbaged = false; mark_window_display_accurate (f->root_window, true); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) FRAME_TERMINAL (f)->frame_up_to_date_hook (f); -- 2.39.5