Support for killing the X terminal

Check whether frames are alive upon teardown, as it might not be
the case when the terminal is killed as
`delete-terminal-functions' might be invoked after the terminal is
deleted.

* exwm-core.el (exwm--terminal): New variable holding the terminal
EXWM runs under.
(exwm-init, exwm-exit): Set and unset it.

* exwm.el (exwm--on-delete-terminal): New function for exiting
EXWM when the terminal is deleted.
(exwm-init): Use it.

* exwm.el (exwm--confirm-kill-terminal, exwm-init): Ask for
confirmation before deleting terminal.

* exwm-workspace.el (exwm-workspace--fullscreen-workspace): New
function.  Ensure the frame is alive.
(exwm-workspace--add-frame-as-workspace): Use it.
(exwm-workspace--exit-minibuffer-frame): Cancel
`exwm-workspace--display-echo-area-timer'.
(exwm-workspace--exit-minibuffer-frame): Ensure the minibuffer
frame is alive.
(exwm-workspace--exit): Ignore dead workspace frames.
This commit is contained in:
Adrián Medraño Calvo 2021-12-09 00:00:00 +00:00
parent a11bb099fb
commit 1aa4ca781d
3 changed files with 63 additions and 25 deletions

View file

@ -59,6 +59,9 @@ Here are some predefined candidates:
(defvar exwm--connection nil "X connection.")
(defvar exwm--terminal nil
"Terminal corresponding to `exwm--connection'.")
(defvar exwm--wmsn-window nil
"An X window owning the WM_S0 selection.")