diff options
| author | Po Lu | 2022-07-21 14:55:05 +0800 |
|---|---|---|
| committer | Po Lu | 2022-07-21 14:55:19 +0800 |
| commit | 50ff15bb8aee1bffbd4a69f8bb7c17c7d11b0bcc (patch) | |
| tree | 1fa9784caeb4c7fdb04e7a6ed12484b4fa85201a /src | |
| parent | 6940cebe032858e307fa24fb32ba9f5c8cb56835 (diff) | |
| download | emacs-50ff15bb8aee1bffbd4a69f8bb7c17c7d11b0bcc.tar.gz emacs-50ff15bb8aee1bffbd4a69f8bb7c17c7d11b0bcc.zip | |
Avoid wasting bandwidth to set user time
* src/xterm.c (x_display_set_last_user_time): Don't change the
user time property if nothing actually changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index e6b098f8830..1e9161c7ab0 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7157,7 +7157,11 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, | |||
| 7157 | bool send_event) | 7157 | bool send_event) |
| 7158 | { | 7158 | { |
| 7159 | #ifndef USE_GTK | 7159 | #ifndef USE_GTK |
| 7160 | struct frame *focus_frame = dpyinfo->x_focus_frame; | 7160 | struct frame *focus_frame; |
| 7161 | Time old_time; | ||
| 7162 | |||
| 7163 | focus_frame = dpyinfo->x_focus_frame; | ||
| 7164 | old_time = dpyinfo->last_user_time; | ||
| 7161 | #endif | 7165 | #endif |
| 7162 | 7166 | ||
| 7163 | #ifdef ENABLE_CHECKING | 7167 | #ifdef ENABLE_CHECKING |
| @@ -7168,8 +7172,11 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, | |||
| 7168 | dpyinfo->last_user_time = time; | 7172 | dpyinfo->last_user_time = time; |
| 7169 | 7173 | ||
| 7170 | #ifndef USE_GTK | 7174 | #ifndef USE_GTK |
| 7171 | if (focus_frame) | 7175 | /* Don't waste bandwidth if the time hasn't actually changed. */ |
| 7176 | if (focus_frame && old_time != dpyinfo->last_user_time) | ||
| 7172 | { | 7177 | { |
| 7178 | time = dpyinfo->last_user_time; | ||
| 7179 | |||
| 7173 | while (FRAME_PARENT_FRAME (focus_frame)) | 7180 | while (FRAME_PARENT_FRAME (focus_frame)) |
| 7174 | focus_frame = FRAME_PARENT_FRAME (focus_frame); | 7181 | focus_frame = FRAME_PARENT_FRAME (focus_frame); |
| 7175 | 7182 | ||