From a8f93651727e5497cb8c0b992da0030f698afff4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Jul 2013 12:59:59 +0300 Subject: [PATCH] Fix bug #14841 with invisible frames on MS-Windows. src/w32term.c (w32_read_socket) : Warn about frame being re-exposed only if it didn't ask to become visible. : Under SIZE_RESTORED, only set the frame visible if it was previously iconified. (x_iconify_frame): Mark the frame iconified. --- src/ChangeLog | 8 ++++++++ src/w32term.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2b105e2405e..59eb16a81e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2013-07-26 Eli Zaretskii + + * w32term.c (w32_read_socket) : Warn about frame + being re-exposed only if it didn't ask to become visible. + : Under SIZE_RESTORED, only set the frame visible if it + was previously iconified. (Bug#14841) + (x_iconify_frame): Mark the frame iconified. + 2013-07-26 Paul Eggert Fix minor problems found by static checking. diff --git a/src/w32term.c b/src/w32term.c index 2fe3fe07462..0b22fd178e4 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4360,8 +4360,9 @@ w32_read_socket (struct terminal *terminal, SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, 0); SET_FRAME_GARBAGED (f); - DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - SDATA (f->name))); + if (!f->output_data.w32->asked_for_visible) + DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, + SDATA (f->name))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -4819,7 +4820,8 @@ w32_read_socket (struct terminal *terminal, { bool iconified = FRAME_ICONIFIED_P (f); - SET_FRAME_VISIBLE (f, 1); + if (iconified) + SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, 0); /* wait_reading_process_output will notice this @@ -6129,6 +6131,9 @@ x_iconify_frame (struct frame *f) /* Simulate the user minimizing the frame. */ SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); + SET_FRAME_VISIBLE (f, 0); + SET_FRAME_ICONIFIED (f, 1); + unblock_input (); } -- 2.39.2