diff --git a/src/xterm.c b/src/xterm.c index 9edaed9a34..153089c1dc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8438,14 +8438,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (not_hidden) { - SET_FRAME_VISIBLE (f, 1); - SET_FRAME_ICONIFIED (f, false); #if defined USE_GTK && defined HAVE_GTK3 /* If GTK3 wants to impose some old size here (Bug#24526), tell it that the current size is what we want. */ - xg_frame_set_char_size - (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)); + if (!FRAME_VISIBLE_P (f) || iconified) + xg_frame_set_char_size + (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)); #endif + SET_FRAME_VISIBLE (f, 1); + SET_FRAME_ICONIFIED (f, false); + f->output_data.x->has_been_visible = true; }