diff options
-rw-r--r-- | exwm-background.el | 2 | ||||
-rw-r--r-- | exwm-config.el | 2 | ||||
-rw-r--r-- | exwm-core.el | 2 | ||||
-rw-r--r-- | exwm-floating.el | 2 | ||||
-rw-r--r-- | exwm-input.el | 21 | ||||
-rw-r--r-- | exwm-layout.el | 2 | ||||
-rw-r--r-- | exwm-manage.el | 2 | ||||
-rw-r--r-- | exwm-randr.el | 2 | ||||
-rw-r--r-- | exwm-systemtray.el | 2 | ||||
-rw-r--r-- | exwm-workspace.el | 2 | ||||
-rw-r--r-- | exwm-xim.el | 2 | ||||
-rw-r--r-- | exwm.el | 16 |
12 files changed, 41 insertions, 16 deletions
diff --git a/exwm-background.el b/exwm-background.el index 9c9bc5e352..44fa5d0377 100644 --- a/exwm-background.el +++ b/exwm-background.el @@ -1,6 +1,6 @@ ;;; exwm-background.el --- X Background Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2022-2023 Free Software Foundation, Inc. +;; Copyright (C) 2022-2024 Free Software Foundation, Inc. ;; Author: Steven Allen <steven@stebalien.com> diff --git a/exwm-config.el b/exwm-config.el index f3357807b5..a9f21e9c8c 100644 --- a/exwm-config.el +++ b/exwm-config.el @@ -1,6 +1,6 @@ ;;; exwm-config.el --- Predefined configurations -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-core.el b/exwm-core.el index 4df57e7381..6683c77120 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -1,6 +1,6 @@ ;;; exwm-core.el --- Core definitions -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-floating.el b/exwm-floating.el index def7f43e53..ebf39c4a5c 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -1,6 +1,6 @@ ;;; exwm-floating.el --- Floating Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-input.el b/exwm-input.el index 05b021093c..a37f416807 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -1,6 +1,6 @@ ;;; exwm-input.el --- Input Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> @@ -102,6 +102,13 @@ defined in `exwm-mode-map' here." (defconst exwm-input--update-focus-interval 0.01 "Time interval (in seconds) for accumulating input focus update requests.") +(defconst exwm-input--passthrough-functions '(read-char + read-char-exclusive + read-key-sequence-vector + read-key-sequence + read-event) + "Low-level functions that read events and need to be exempted from EXWM's input handling.") + (defvar exwm-input--during-command nil "Indicate whether between `pre-command-hook' and `post-command-hook'.") @@ -1158,6 +1165,11 @@ One use is to access the keymap bound to KEYS (as prefix keys) in `char-mode'." (exwm--log) (exwm-input--on-minibuffer-exit))) +(defun exwm-input--call-with-passthrough (function &rest args) + "Bind `exwm-input-line-mode-passthrough' and call the specified FUNCTION with ARGS." + (let ((exwm-input-line-mode-passthrough t)) + (apply function args))) + (defun exwm-input--init () "Initialize the keyboard module." (exwm--log) @@ -1213,7 +1225,10 @@ One use is to access the keymap bound to KEYS (as prefix keys) in `char-mode'." (run-with-idle-timer 0 t #'exwm-input--on-echo-area-dirty)) (add-hook 'echo-area-clear-hook #'exwm-input--on-echo-area-clear) ;; Update focus when buffer list updates - (add-hook 'buffer-list-update-hook #'exwm-input--on-buffer-list-update)) + (add-hook 'buffer-list-update-hook #'exwm-input--on-buffer-list-update) + + (dolist (fun exwm-input--passthrough-functions) + (advice-add fun :around #'exwm-input--call-with-passthrough))) (defun exwm-input--post-init () "The second stage in the initialization of the input module." @@ -1223,6 +1238,8 @@ One use is to access the keymap bound to KEYS (as prefix keys) in `char-mode'." (defun exwm-input--exit () "Exit the input module." (exwm--log) + (dolist (fun exwm-input--passthrough-functions) + (advice-remove fun #'exwm-input--call-with-passthrough)) (exwm-input--unset-simulation-keys) (remove-hook 'pre-command-hook #'exwm-input--on-pre-command) (remove-hook 'post-command-hook #'exwm-input--on-post-command) diff --git a/exwm-layout.el b/exwm-layout.el index e47620de3b..91764ad1c3 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -1,6 +1,6 @@ ;;; exwm-layout.el --- Layout Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-manage.el b/exwm-manage.el index 4771c3c088..7c7ad3901e 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -1,7 +1,7 @@ ;;; exwm-manage.el --- Window Management Module for -*- lexical-binding: t -*- ;;; EXWM -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-randr.el b/exwm-randr.el index 8d1824babb..abfa84fe81 100644 --- a/exwm-randr.el +++ b/exwm-randr.el @@ -1,6 +1,6 @@ ;;; exwm-randr.el --- RandR Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-systemtray.el b/exwm-systemtray.el index 7f2b268df9..441da956e3 100644 --- a/exwm-systemtray.el +++ b/exwm-systemtray.el @@ -1,7 +1,7 @@ ;;; exwm-systemtray.el --- System Tray Module for -*- lexical-binding: t -*- ;;; EXWM -;; Copyright (C) 2016-2023 Free Software Foundation, Inc. +;; Copyright (C) 2016-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-workspace.el b/exwm-workspace.el index 61e2f69d28..472b2c2d74 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -1,6 +1,6 @@ ;;; exwm-workspace.el --- Workspace Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 1015-2023 Free Software Foundation, Inc. +;; Copyright (C) 1015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm-xim.el b/exwm-xim.el index aea0eb53fb..1f0c9c460b 100644 --- a/exwm-xim.el +++ b/exwm-xim.el @@ -1,6 +1,6 @@ ;;; exwm-xim.el --- XIM Module for EXWM -*- lexical-binding: t -*- -;; Copyright (C) 2019-2023 Free Software Foundation, Inc. +;; Copyright (C) 2019-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> diff --git a/exwm.el b/exwm.el index 5745533720..398279dc86 100644 --- a/exwm.el +++ b/exwm.el @@ -1,11 +1,11 @@ ;;; exwm.el --- Emacs X Window Manager -*- lexical-binding: t -*- -;; Copyright (C) 2015-2023 Free Software Foundation, Inc. +;; Copyright (C) 2015-2024 Free Software Foundation, Inc. ;; Author: Chris Feng <chris.w.feng@gmail.com> ;; Maintainer: Adrián Medraño Calvo <adrian@medranocalvo.com> ;; Version: 0.28 -;; Package-Requires: ((xelb "0.18")) +;; Package-Requires: ((emacs "26.1") (xelb "0.18")) ;; Keywords: unix ;; URL: https://github.com/ch11ng/exwm @@ -110,6 +110,9 @@ (defconst exwm--server-name "server-exwm" "Name of the subordinate Emacs server.") +(defvar exwm--server-timeout 1 + "Number of seconds to wait for the subordinate Emacs server to exit before killing it.") + (defvar exwm--server-process nil "Process of the subordinate Emacs server.") (defun exwm-reset () @@ -999,8 +1002,13 @@ FRAME, if given, indicates the X display EXWM should manage." (defun exwm--server-stop () "Stop the subordinate Emacs server." (exwm--log) - (server-force-delete exwm--server-name) (when exwm--server-process + (when (process-live-p exwm--server-process) + (cl-loop + initially (signal-process exwm--server-process 'TERM) + while (process-live-p exwm--server-process) + repeat (* 10 exwm--server-timeout) + do (sit-for 0.1))) (delete-process exwm--server-process) (setq exwm--server-process nil))) @@ -1017,7 +1025,7 @@ FUNCTION is the function to be evaluated, ARGS are the arguments." (car command-line-args) ;The executable file "-d" (frame-parameter nil 'display) "-Q" - (concat "--daemon=" exwm--server-name) + (concat "--fg-daemon=" exwm--server-name) "--eval" ;; Create an invisible frame "(make-frame '((window-system . x) (visibility)))")) |