diff options
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/xterm-kitty.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/term/xterm-kitty.el b/lisp/term/xterm-kitty.el index 9706fbb..bc65e6d 100644 --- a/lisp/term/xterm-kitty.el +++ b/lisp/term/xterm-kitty.el @@ -456,12 +456,19 @@ function is almost equivalent to 'event-convert-list'." (when (xterm-kitty-in-use) ;; Terminal emacs thinks that only one frame is ever visible (funcall old-function window minibuf (if (eql all-frames 'visible) t all-frames)))) -(defun xterm-kitty-add-select-frame-set-input-focus-advice () + +(defvar xterm-kitty--skip-select-frame-set-input-focus-advice nil + "Set to true to disable setting input focus advice") +(defun xterm-kitty-add-select-frame-set-input-focus-advice (&optional print-message) "Advise SELECT-FRAME-SET-INPUT-FOCUS to handle xterm-kitty terminal windows" - (interactive) - (advice-add 'select-frame-set-input-focus :around #'xterm-kitty-select-frame-set-input-focus-advice) - (advice-add 'next-window :around #'xterm-kitty-visible-window-advice) - (advice-add 'previous-window :around #'xterm-kitty-visible-window-advice)) + (interactive "p") + (if xterm-kitty--skip-select-frame-set-input-focus-advice + (when print-message + (message "Input focus advice for selecting frames disabled")) + (advice-add 'select-frame-set-input-focus :around #'xterm-kitty-select-frame-set-input-focus-advice) + (advice-add 'next-window :around #'xterm-kitty-visible-window-advice) + (advice-add 'previous-window :around #'xterm-kitty-visible-window-advice) + (setq xterm-kitty--skip-select-frame-set-input-focus-advice t))) (defvar xterm-kitty--new-os-window-command-string "\eP@kitty-cmd{\"cmd\":\"new-window\",\"version\":[0,19,3],\"no_response\":true,\"payload\":{\"window_type\":\"os\"}}\e\\" |
