]> git.eshelyaron.com Git - emacs.git/commit
New focus management interface
authorDaniel Colascione <dancol@dancol.org>
Mon, 11 Jun 2018 21:58:09 +0000 (14:58 -0700)
committerDaniel Colascione <dancol@dancol.org>
Mon, 11 Jun 2018 23:10:34 +0000 (16:10 -0700)
commit2f6c682061a281dc3e397ff4727a164880e86e7b
treef5990303d483f7d80e1aa1e80a19dc64a6325b66
parenta20fe5a7e3577f9b9ad5e88006962966240d9b0c
New focus management interface

focus-in-hook and focus-out-hook don't accurately reflect actual
user-visible focus states.  Add a new focus interface and mark the old
one obsolete.

* doc/lispref/frames.texi (Input Focus): Document new focus
functions.  Remove references to the now-obsolete focus hooks.

* lisp/frame.el (frame-focus-state): New function.
(after-focus-change-function): New variable.
(focus-in-hook, focus-out-hook): Move to lisp from C;
mark obsolete.

* lisp/term/xterm.el (xterm-translate-focus-in)
(xterm-translate-focus-out): Track tty focus in `tty-focus-state'
terminal parameter; call `after-focus-change-function'.
(xterm--suspend-tty-function): New function.

* src/frame.c (Fhandle_switch_frame): Update docstring; don't call
focus hooks.
(focus-in-hook, focus-out-hook): Remove: moved to lisp.
(syms_of_frame): Remove unread_switch_frame; add
Vunread_switch_frame.

* src/keyboard.c:
(Finternal_handle_focus_in): New function.
(make_lispy_event): Always report focus events to lisp; don't
translate them to switch events sometimes.  Lisp can take care of
creating synthetic switch-frame events via
`internal-handle-focus-in'.

* src/w32term.c (x_focus_changed): Remove switch-avoidance logic:
just directly report focus changes to lisp.

* src/xterm.c (x_focus_changed): Remove switch-avoidance logic:
just directly report focus changes to lisp.
doc/lispref/frames.texi
etc/NEWS
lisp/frame.el
lisp/term/xterm.el
src/frame.c
src/keyboard.c
src/w32term.c
src/xterm.c