about summary refs log tree commit diff
path: root/exwm-core.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2021-12-09T00·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2021-12-09T00·00+0000
commit1aa4ca781dff7853bf6ed01e5e397793fb3ee661 (patch)
treecad70bafebe98bbe0f184360f8a7f0e00d8312d1 /exwm-core.el
parenta11bb099fbd0b755d9a6d80a63a0dcd275280e33 (diff)
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.
Diffstat (limited to 'exwm-core.el')
-rw-r--r--exwm-core.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/exwm-core.el b/exwm-core.el
index 5356ef9b97..5bcf943858 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -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.")