请教:怎么用elisp判断当前窗口管理器中的当前窗口是emacs

我不想通过timer更新buffer输入法状态,imbot.el需要这个功能

;; to update input method status variable:
;; in your window manager(global hotkey manager), bind command below to a input method toggle key
;; emacsclient -e '(imbot--toggle-im-state)'
(defun imbot--toggle-im-state ()
(interactive)
(with-selected-window (selected-window)
    (if (imbot--im-active-p)
        (imbot--deactivate-im)
        (imbot--activate-im))
    ;; if emacs is under focus, update input method state for current buffer
    (imbot--save-state)))