From a12f4a133aa4697494cdb04fbaaef2471fe72269 Mon Sep 17 00:00:00 2001 From: Tom Gillespie Date: Fri, 14 May 2021 18:47:48 -0700 Subject: [PATCH] Fix rendering issues on window managers without _NET_WM_STATE * src/xterm.c (handle_one_xevent): MapNotify handle cases where window manager is missing _NET_WM_STATE. Partially reverts a change introduced in 483c5e953c12a95382bef4a3b6769a680c32fe86 which made previously unconditional calls to SET_FRAME_VISIBLE, and SET_FRAME_ICONIFIED conditional on the not_hidden variable. On window managers missing _NET_WM_STATE it seems that not_hidden = false does not imply visible = false because x_get_current_wm_state will return false when _NET_WM_STATE and a frame is visible. --- src/xterm.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index bdf0804f89..67c6eaa719 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8440,22 +8440,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_set_z_group (f, Qbelow, Qnil); } - if (not_hidden) - { - SET_FRAME_VISIBLE (f, 1); - SET_FRAME_ICONIFIED (f, false); + 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. */ - if (f->was_invisible) - { - xg_frame_set_char_size - (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)); - f->was_invisible = false; - } -#endif - f->output_data.x->has_been_visible = true; + /* If GTK3 wants to impose some old size here (Bug#24526), + tell it that the current size is what we want. */ + if (f->was_invisible) + { + xg_frame_set_char_size + (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)); + f->was_invisible = false; } +#endif + f->output_data.x->has_been_visible = true; if (not_hidden && iconified) { -- 2.26.3