[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c9fd83e 3/3: Always set xwidget title if the event was "load-fini
From: |
Lars Ingebrigtsen |
Subject: |
master c9fd83e 3/3: Always set xwidget title if the event was "load-finished" |
Date: |
Tue, 9 Nov 2021 01:47:23 -0500 (EST) |
branch: master
commit c9fd83e3034ddd1e2d1a8eeafc7f12d6e3df5249
Author: Po Lu <luangruo@yahoo.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Always set xwidget title if the event was "load-finished"
* lisp/xwidget.el (xwidget-webkit-callback): Always set title upon
load completion. This prevents loading pages such as "about:blank"
from not setting the buffer name (bug#51702).
---
lisp/xwidget.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index fc37798..9053270 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -360,9 +360,11 @@ XWIDGET instance, XWIDGET-EVENT-TYPE depends on the
originating xwidget."
(cond ((eq xwidget-event-type 'load-changed)
(let ((title (xwidget-webkit-title xwidget)))
;; This funciton will be called multi times, so only
- ;; change buffer name when get a valid title. this can
- ;; limit buffer-name flicker in mode-line.
- (when (> (length title) 0)
+ ;; change buffer name when the load actually completes
+ ;; this can limit buffer-name flicker in mode-line.
+ (when (or (string-equal (nth 3 last-input-event)
+ "load-finished")
+ (> (length title) 0))
(with-current-buffer (xwidget-buffer xwidget)
(setq xwidget-webkit--title title)
(force-mode-line-update)