Subject: bug#61667: 29.0.60; Failure to redisplay

From: Eli Zaretskii <[email-masked]>
Date: Wed, 22 Feb 2023 14:17:45 +0200

> From: Po Lu <[email-masked]>
> Cc: Dmitry Gutov <[email-masked]>,  [email-masked]
> Date: Wed, 22 Feb 2023 10:41:20 +0800
> 
> Would you please start by instrumenting xterm.c as follows?
> 
> diff --git a/src/xterm.c b/src/xterm.c
> index 5feaa4aef0f..999ae5d37fb 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -7518,6 +7518,10 @@ XTframe_up_to_date (struct frame *f)
>    FRAME_MOUSE_UPDATE (f);
>  
>  #ifdef HAVE_XDBE
> +  fprintf (stderr, "XTframe_up_to_date: %d, %d\n",
> +	   buffer_flipping_blocked_p (),
> +	   FRAME_X_NEED_BUFFER_FLIP (f));
> +
>    if (!buffer_flipping_blocked_p ()
>        && FRAME_X_NEED_BUFFER_FLIP (f))
>      show_back_buffer (f);
> @@ -17736,6 +17740,8 @@ x_flush_dirty_back_buffer_on (struct frame *f)
>        || !FRAME_X_NEED_BUFFER_FLIP (f))
>      return;
>  
> +  fprintf (stderr, "x_flush_dirty_back_buffer_on: called\n");

Careful with printfs, since we know this problem goes away when there
are too many of them.  Use fputs whenever you can, since fprintf can
be much more expensive.