unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, 61667@debbugs.gnu.org, gregory@heytings.org
Subject: bug#61667: 29.0.60; Failure to redisplay
Date: Fri, 24 Feb 2023 23:03:12 +0200	[thread overview]
Message-ID: <17adc089-9773-0e1c-8345-1f289e3285a4@yandex.ru> (raw)
In-Reply-To: <838rgnnlt0.fsf@gnu.org>

On 24/02/2023 17:08, Eli Zaretskii wrote:
>> Date: Fri, 24 Feb 2023 16:12:30 +0200
>> Cc: luangruo@yahoo.com, 61667@debbugs.gnu.org, gregory@heytings.org
>> From: Dmitry Gutov <dgutov@yandex.ru>
>>
>>>> - Before this commit: the window title doesn't change, it's always
>>>> emacs@hostname. But when I press 'a' (bound to 'find-file' lambda),
>>>> there never is a noticeable delay before the window contents change. The
>>>> buffer is displayed instantly.
>>> How is this consistent with your previous finding that the problem
>>> exists in Emacs 25, 26, and 27.  The change above is only present in
>>> Emacs 28.  Does this mean that the problem 100-200ms delay and the
>>> original problem are two different problems?
>>
>> Easy: my configuration contains a customization for frame-title-format.
>>
>> It's set to
>>
>>     (setq frame-title-format '(buffer-file-name "%f" ("%b")))
>>
>> All the time I spend bisecting the config I didn't think to change it
>> (it's the very first line). And this makes the problem appear with Emacs
>> 27 and 26 too.
> 
> So the hypothesis now is that changes in the frame's title, which
> cause Emacs to update the title by issuing GTK and/or X calls, somehow
> cause the problem, is that right?

I suppose so.

>>> Anyway, if the changes in the frame's title are somehow related to
>>> this, their effect is to cause Emacs to call x_set_name_internal to
>>> display the new title.  Could it be that this function takes such a
>>> long time to execute?  Or does it have some strange effect on the WM?
>>
>> My vague (and likely wrong) guess would be that the WM knows it needs
>> some update from the Emacs window, gets it from the title bar before
>> everything else, and marks the update as completed.
> 
> Can you please time that function anyway, if only to make sure the
> problem is elsewhere?  How much time does it take x_set_name_internal
> since its call till it returns, when it actually changes the frame's
> title?

Okay, done. It was a reasonable guess, that if the update is 
synchronous, it might stall for some reason. But that doesn't seem to be 
the case. It takes about the same time when the bug manifests as when it 
does not:

[x_set_name] time to x_set_name_internal: 49
[x_set_name] time to x_set_name_internal: 20

Here's the patch I used, if you want to check or modify it:

diff --git a/src/xfns.c b/src/xfns.c
index 528ae61ca32..b8ce75469c7 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2238,6 +2238,13 @@ x_set_name_internal (struct frame *f, Lisp_Object 
name)
      }
  }

+int64_t now_millis() {
+  struct timespec now;
+  timespec_get(&now, TIME_UTC);
+
+  return ((int64_t) now.tv_sec) * 1000 + ((int64_t) now.tv_nsec) / 1000;
+}
+
  /* Change the name of frame F to NAME.  If NAME is nil, set F's name to
         x_id_name.

@@ -2290,7 +2297,11 @@ x_set_name (struct frame *f, Lisp_Object name, 
bool explicit)
    if (! NILP (f->title))
      name = f->title;

+  int64_t was = now_millis();
+
    x_set_name_internal (f, name);
+
+  fprintf (stderr, "[x_set_name] time to x_set_name_internal: %ld\n", 
now_millis() - was);
  }

  /* This function should be called when the user's lisp code has
@@ -2330,7 +2341,11 @@ x_set_title (struct frame *f, Lisp_Object name, 
Lisp_Object old_name)
    else
      CHECK_STRING (name);

+  int64_t was = now_millis();
+
    x_set_name_internal (f, name);
+
+  fprintf (stderr, "[x_set_title] time to x_set_name_internal: %ld\n", 
now_millis() - was);
  }





  reply	other threads:[~2023-02-24 21:03 UTC|newest]

Thread overview: 192+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  2:53 bug#61667: 29.0.60; Failure to redisplay Dmitry Gutov
2023-02-21  7:32 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 10:04   ` Dmitry Gutov
2023-02-21 10:19     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 10:43       ` Dmitry Gutov
2023-02-21 11:08         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 12:58         ` Eli Zaretskii
2023-02-21 15:51           ` Dmitry Gutov
2023-02-21 16:05             ` Eli Zaretskii
2023-02-21 17:25               ` Dmitry Gutov
2023-02-21 18:31                 ` Eli Zaretskii
2023-02-21 20:53                   ` Dmitry Gutov
2023-02-22  2:41                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-22 12:17                     ` Eli Zaretskii
2023-02-22 16:24                       ` Dmitry Gutov
2023-02-22 16:29                         ` Gregory Heytings
2023-02-23  0:51                           ` Dmitry Gutov
2023-02-23  1:03                             ` Gregory Heytings
2023-02-23 13:41                               ` Dmitry Gutov
2023-02-23 13:58                                 ` Gregory Heytings
2023-02-23 16:46                                   ` Dmitry Gutov
2023-02-23 17:10                                     ` Eli Zaretskii
2023-02-23 19:12                                       ` Dmitry Gutov
2023-02-23 19:24                                         ` Eli Zaretskii
2023-02-23 20:05                                           ` Dmitry Gutov
2023-02-24  6:48                                             ` Eli Zaretskii
2023-02-24 11:55                                     ` Gregory Heytings
2023-02-24 13:12                                     ` Dmitry Gutov
2023-02-24 13:20                                       ` Gregory Heytings
2023-02-24 13:29                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24 13:46                                         ` Dmitry Gutov
2023-02-24 13:54                                           ` Gregory Heytings
2023-02-24 14:54                                             ` Dmitry Gutov
2023-02-24 15:12                                               ` Gregory Heytings
2023-02-24 22:25                                                 ` Gregory Heytings
2023-02-24 23:34                                                   ` Dmitry Gutov
2023-02-24 23:48                                                     ` Gregory Heytings
2023-02-25  0:37                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-26  0:35                                                         ` Gregory Heytings
2023-02-25 23:34                                                       ` Dmitry Gutov
2023-02-26  0:41                                                         ` Gregory Heytings
2023-02-26  0:56                                                           ` Dmitry Gutov
2023-02-26  1:02                                                             ` Gregory Heytings
2023-02-26  1:36                                                               ` Dmitry Gutov
2023-02-26  1:53                                                                 ` Gregory Heytings
2023-02-26  2:00                                                                   ` Dmitry Gutov
2023-02-26  2:39                                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-26 12:15                                                                       ` Dmitry Gutov
2023-02-28 10:24                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-26  6:44                                                                     ` Eli Zaretskii
2023-02-26 11:59                                                                       ` Dmitry Gutov
2023-02-26 12:13                                                                         ` Eli Zaretskii
2023-02-26 12:23                                                                           ` Dmitry Gutov
2023-02-26 12:31                                                                             ` Eli Zaretskii
2023-02-26 13:21                                                                               ` Dmitry Gutov
2023-02-26 13:44                                                                                 ` Eli Zaretskii
2023-02-26 14:42                                                                                   ` Dmitry Gutov
2023-02-26 15:00                                                                                     ` Eli Zaretskii
2023-02-26 15:50                                                                                       ` Dmitry Gutov
2023-02-26 14:44                                                                                   ` Gregory Heytings
2023-02-26 15:45                                                                                     ` Dmitry Gutov
2023-02-26 15:54                                                                                       ` Gregory Heytings
2023-02-26 17:00                                                                                         ` Dmitry Gutov
2023-02-26 23:22                                                                                           ` Dmitry Gutov
2023-02-27 10:30                                                                                             ` Gregory Heytings
2023-02-27 20:55                                                                                               ` Dmitry Gutov
2023-02-27 22:41                                                                                                 ` Gregory Heytings
2023-02-27 23:47                                                                                                   ` Dmitry Gutov
2023-02-28 10:31                                                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 17:59                                                                                                 ` Dmitry Gutov
2023-02-28 22:06                                                                                                   ` Dmitry Gutov
2023-03-01  1:11                                                                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01  1:25                                                                                                     ` Dmitry Gutov
2023-03-01  4:50                                                                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 11:15                                                                                                         ` Dmitry Gutov
2023-03-01 12:10                                                                                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 12:19                                                                                                             ` Dmitry Gutov
2023-03-01 12:41                                                                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 14:33                                                                                                                 ` Dmitry Gutov
2023-03-02  0:34                                                                                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02  1:44                                                                                                                     ` Dmitry Gutov
2023-03-02  4:11                                                                                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02  7:11                                                                                                                         ` Eli Zaretskii
2023-03-03 14:28                                                                                                                           ` Dmitry Gutov
2023-03-04  0:01                                                                                                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04  0:22                                                                                                                               ` Dmitry Gutov
2023-03-04 12:45                                                                                                                                 ` Dmitry Gutov
2023-03-12 21:55                                                                                                                                   ` Dmitry Gutov
2023-03-02  9:21                                                                                                                         ` Gregory Heytings
2023-03-02 10:24                                                                                                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02 11:30                                                                                                                             ` Gregory Heytings
2023-03-02  9:30                                                                                                                         ` Gregory Heytings
2023-03-02 10:29                                                                                                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-02 12:29                                                                                                                             ` Dmitry Gutov
2023-03-02 13:39                                                                                                                           ` Dmitry Gutov
2023-03-02 15:45                                                                                                                             ` Dmitry Gutov
2023-03-03  0:54                                                                                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-03  7:29                                                                                                                                 ` Eli Zaretskii
2023-03-03 13:06                                                                                                                                   ` Dmitry Gutov
2023-03-03 13:44                                                                                                                                 ` Dmitry Gutov
2023-03-12  2:27                                                                                                                                   ` Dmitry Gutov
2023-03-12  2:43                                                                                                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-12 12:15                                                                                                                                       ` Dmitry Gutov
2023-03-12 12:19                                                                                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-12 21:53                                                                                                                                           ` Dmitry Gutov
2023-04-16  0:48                                                                                                                                   ` Dmitry Gutov
2023-04-16  6:01                                                                                                                                     ` Eli Zaretskii
2023-04-16 12:52                                                                                                                                       ` Dmitry Gutov
2023-04-16 12:59                                                                                                                                         ` Eli Zaretskii
2023-04-16 13:08                                                                                                                                           ` Dmitry Gutov
2023-04-16 16:17                                                                                                                                             ` Eli Zaretskii
2023-04-16 17:14                                                                                                                                               ` Dmitry Gutov
2023-04-16 17:26                                                                                                                                                 ` Eli Zaretskii
2023-04-16 17:47                                                                                                                                                   ` Dmitry Gutov
2023-04-16 18:11                                                                                                                                                     ` Dmitry
2023-04-16 19:01                                                                                                                                                     ` Eli Zaretskii
2023-04-16 21:17                                                                                                                                                       ` Dmitry Gutov
2023-04-17  2:27                                                                                                                                                         ` Eli Zaretskii
2023-04-18  0:28                                                                                                                                                           ` Dmitry Gutov
2023-04-18 17:00                                                                                                                                                             ` Eli Zaretskii
2023-04-18 22:31                                                                                                                                                               ` Dmitry Gutov
2023-04-16 16:27                                                                                                                                             ` Eli Zaretskii
2023-04-16 17:46                                                                                                                                               ` Dmitry Gutov
2023-04-16 18:50                                                                                                                                                 ` Eli Zaretskii
2023-04-16 22:26                                                                                                                                                   ` Dmitry Gutov
2023-04-17  2:31                                                                                                                                                     ` Eli Zaretskii
2023-04-17 23:07                                                                                                                                                       ` Dmitry Gutov
2023-04-17 23:20                                                                                                                                                         ` Dmitry Gutov
2023-04-18  1:35                                                                                                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-18  1:43                                                                                                                                                           ` Dmitry Gutov
2023-04-18  2:12                                                                                                                                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-18  7:01                                                                                                                                                             ` Andreas Schwab
2023-04-18 11:05                                                                                                                                                               ` Dmitry Gutov
2023-04-19  1:13                                                                                                                                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-19  1:23                                                                                                                                                                   ` Dmitry Gutov
2023-04-22  1:55                                                                                                                                     ` Gabriel
2023-04-22  7:34                                                                                                                                       ` Eli Zaretskii
2023-04-22 18:37                                                                                                                                       ` Dmitry Gutov
2023-03-02 13:20                                                                                                                         ` Dmitry Gutov
2023-02-26 13:15                                                                         ` Gregory Heytings
2023-02-26 13:31                                                                           ` Dmitry Gutov
2023-02-26  6:06                                                             ` Eli Zaretskii
2023-02-25  7:57                                                     ` Eli Zaretskii
2023-02-25 13:57                                                       ` Dmitry Gutov
2023-02-24 14:01                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24 14:14                                             ` Dmitry Gutov
2023-02-24 15:12                                               ` Eli Zaretskii
2023-02-24 15:35                                                 ` Dmitry Gutov
2023-02-24 15:51                                                   ` Eli Zaretskii
2023-02-24 15:57                                                     ` Eli Zaretskii
2023-02-24 19:33                                                       ` Dmitry Gutov
2023-02-24 16:15                                                     ` Dmitry Gutov
2023-02-25  5:35                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-25 13:56                                                         ` Dmitry Gutov
2023-02-26  0:39                                                         ` Dmitry Gutov
2023-02-24 13:46                                       ` Eli Zaretskii
2023-02-24 14:12                                         ` Dmitry Gutov
2023-02-24 15:08                                           ` Eli Zaretskii
2023-02-24 21:03                                             ` Dmitry Gutov [this message]
2023-02-24 21:19                                               ` Eli Zaretskii
2023-02-24 21:49                                                 ` Dmitry Gutov
2023-02-25  7:12                                                   ` Eli Zaretskii
2023-02-25  7:21                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-25 13:18                                                       ` Dmitry Gutov
2023-02-23  6:27                             ` Eli Zaretskii
2023-02-23  9:41                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-23 12:00                                 ` Dmitry Gutov
2023-02-23 13:13                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-23 14:01                                     ` Dmitry Gutov
2023-02-24  0:59                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24  1:09                                         ` Dmitry Gutov
2023-02-24  7:18                                         ` Eli Zaretskii
2023-02-24 11:59                                           ` Gregory Heytings
2023-02-24 12:51                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24 12:32                                         ` Dmitry Gutov
2023-02-24 12:56                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24 13:32                                             ` Dmitry Gutov
2023-02-24 13:58                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-24 14:29                                                 ` Dmitry Gutov
2023-02-24 13:32                                         ` Dmitry Gutov
2023-02-22 17:07                         ` Eli Zaretskii
2023-02-22 22:36                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-22 23:17                             ` Dmitry Gutov
2023-02-23  6:20                             ` Eli Zaretskii
2023-02-22 16:33                     ` Dmitry Gutov
2023-02-21 12:23 ` Eli Zaretskii
2023-02-21 15:43   ` Dmitry Gutov
2023-02-21 16:16     ` Eli Zaretskii
2023-02-21 17:07       ` Robert Pluim
2023-02-21 17:14         ` Robert Pluim
2023-02-21 20:46         ` Dmitry Gutov
2023-02-21 16:18     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17adc089-9773-0e1c-8345-1f289e3285a4@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=61667@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gregory@heytings.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).