Subject: Re: bug#61667: 29.0.60; Failure to redisplay

From: Dmitry Gutov <[email-masked]>
Date: Wed, 22 Feb 2023 18:24:43 +0200

On 22/02/2023 14:17, Eli Zaretskii wrote:
>>   #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.

Indeed, I haven't managed to reproduce the problem even once when the 
printing patch is applied.

I've  also tried this one, with the same lack of success:

diff --git a/src/xterm.c b/src/xterm.c
index e981a36fa9c..7829ad6b0e8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7394,6 +7394,18 @@ XTframe_up_to_date (struct frame *f)
    FRAME_MOUSE_UPDATE (f);

  #ifdef HAVE_XDBE
+  fputs ("XTframe_up_to_date: ", stderr);
+  if (buffer_flipping_blocked_p ())
+    fputs ("1", stderr);
+  else
+    fputs ("0", stderr);
+  fputs (", ", stderr);
+  if (FRAME_X_NEED_BUFFER_FLIP (f))
+    fputs ("1", stderr);
+  else
+    fputs ("0", stderr);
+  fputs ("\n", stderr);
+
    if (!buffer_flipping_blocked_p ()
        && FRAME_X_NEED_BUFFER_FLIP (f))
      show_back_buffer (f);
@@ -17509,6 +17521,8 @@ x_flush_dirty_back_buffer_on (struct frame *f)
        || !FRAME_X_NEED_BUFFER_FLIP (f))
      return;

+  fputs ("x_flush_dirty_back_buffer_on: called\n", stderr);
+
    show_back_buffer (f);
  #endif
  }