Subject: Re: bug#45834: 28.0.50; Mouse events in terminal emacs

From: Eli Zaretskii <[email-masked]>
Date: Wed, 08 Sep 2021 12:51:01 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked]
> Date: Wed, 08 Sep 2021 11:34:04 +0200
> 
> Poking at this a bit more -- the translation of these events apparently
> relied on some magic in `read-event':
> 
>     ;; These translation functions actually call the focus handlers            
>     ;; internally and return an empty sequence, causing us to go on to         
>     ;; read the next event.                                                    
>     (define-key map "\e[I" #'xterm-translate-focus-in)
> 
> ;; By returning an empty key sequence, these two functions perform the         
> ;; moral equivalent of the kind of transparent event processing done           
> ;; by read-event's handling of special-event-map, but inside                   
> ;; read-key-sequence (which can recognize multi-character terminal             
> ;; notifications) instead of read-event (which can't).                         
> 
> (defun xterm-translate-focus-in (_prompt)
>   (setf (terminal-parameter nil 'tty-focus-state) 'focused)
>   (funcall after-focus-change-function)
>   [])
> 
> This works in Emacs 26.1, but not Emacs 27.1.

Meaning what? that xterm-translate-focus-in is no longer being called?
But you said up-thread that the handler _is_ being called.