From a5a8cca0730ba19284b6d26259ee70110f314fb6 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 3 Jul 2025 20:34:16 +0300 Subject: [PATCH] Don't ignore mouse release event in display-buffer-override-next-command * lisp/window.el (display-buffer-override-next-command): Don't exit on mouse down event, thus waiting for the incoming mouse up event (bug#78945). (cherry picked from commit 3b6e8c5e3c464efbf01d51f39d044cf9d24f5eaf) --- lisp/window.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 79babd43d6f..f8f9e3113ad 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9625,12 +9625,15 @@ to deactivate this overriding action." (fset postfun (lambda () (unless (or - ;; Remove the hook immediately - ;; after exiting the minibuffer. - (> (minibuffer-depth) minibuffer-depth) - ;; But don't remove immediately after - ;; adding the hook by the same command below. - (eq this-command command)) + ;; Remove the hook immediately + ;; after exiting the minibuffer. + (> (minibuffer-depth) minibuffer-depth) + ;; But don't remove immediately after + ;; adding the hook by the same command below. + (eq this-command command) + ;; Don't exit on mouse down event + ;; in anticipation of mouse release event. + (memq 'down (event-modifiers last-input-event))) (funcall exitfun)))) ;; Call post-function after the next command finishes (bug#49057). (add-hook 'post-command-hook postfun) -- 2.39.5