[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm a11bb099fb 2/8: Refactor re-creation of last frame
From: |
ELPA Syncer |
Subject: |
[elpa] externals/exwm a11bb099fb 2/8: Refactor re-creation of last frame |
Date: |
Tue, 22 Nov 2022 18:57:43 -0500 (EST) |
branch: externals/exwm
commit a11bb099fbd0b755d9a6d80a63a0dcd275280e33
Author: Adrián Medraño Calvo <adrian@medranocalvo.com>
Commit: Adrián Medraño Calvo <adrian@medranocalvo.com>
Refactor re-creation of last frame
* exwm-workspace.el (exwm-workspace--get-next-workspace): Return
nil when there's only one frame.
(exwm-workspace--on-delete-frame)
(exwm-workspace--remove-frame-as-workspace): Create a workspace
when removing the last one, for X windows to be moved to.
---
exwm-workspace.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/exwm-workspace.el b/exwm-workspace.el
index dbb6e6c9fd..3bdbd472f4 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -1389,7 +1389,8 @@ Return nil if FRAME is the only workspace."
(let* ((index (exwm-workspace--position frame))
(lastp (= index (1- (exwm-workspace--count))))
(nextw (elt exwm-workspace--list (+ index (if lastp -1 +1)))))
- nextw))
+ (unless (eq frame nextw)
+ nextw)))
(defun exwm-workspace--remove-frame-as-workspace (frame)
"Stop treating frame FRAME as a workspace."
@@ -1401,6 +1402,11 @@ Return nil if FRAME is the only workspace."
;; Need to remove the workspace from the list for the correct calculation
of
;; indexes below.
(setq exwm-workspace--list (delete frame exwm-workspace--list))
+ (unless next-frame
+ ;; The user managed to delete the last workspace, so create a new one.
+ (exwm--log "Last workspace deleted; create a new one")
+ (let ((exwm-workspace--create-silently t))
+ (setq next-frame (make-frame))))
(dolist (pair exwm--id-buffer-alist)
(let ((other-frame (buffer-local-value 'exwm--frame (cdr pair))))
;; Move X windows to next-frame.
@@ -1454,13 +1460,6 @@ Return nil if FRAME is the only workspace."
((not (exwm-workspace--workspace-p frame))
(exwm--log "Frame `%s' is not a workspace" frame))
(t
- (when (= 1 (exwm-workspace--count))
- ;; The user managed to delete the last workspace, so create a new one.
- (exwm--log "Last workspace deleted; create a new one")
- ;; TODO: this makes sense in the hook. But we need a function that takes
- ;; care of converting a workspace into a regular unmanaged frame.
- (let ((exwm-workspace--create-silently t))
- (make-frame)))
(exwm-workspace--remove-frame-as-workspace frame)
(remhash frame exwm-workspace--client-p-hash-table))))
- [elpa] externals/exwm updated (6408a74312 -> b62d5e79b0), ELPA Syncer, 2022/11/22
- [elpa] externals/exwm 62ffde76aa 1/8: Refactor `exwm-workspace--get-remove-frame-next-workspace', ELPA Syncer, 2022/11/22
- [elpa] externals/exwm d4a7d16676 5/8: Improve confirmation prompts, ELPA Syncer, 2022/11/22
- [elpa] externals/exwm a11bb099fb 2/8: Refactor re-creation of last frame,
ELPA Syncer <=
- [elpa] externals/exwm b62d5e79b0 8/8: Use `active-minibuffer-window' rather than `minibuffer-window', ELPA Syncer, 2022/11/22
- [elpa] externals/exwm 1c706daeb0 7/8: Merge branch 'drop-client-p' into externals/exwm, ELPA Syncer, 2022/11/22
- [elpa] externals/exwm ca7623349e 4/8: Leave `client' frame parameter in place, ELPA Syncer, 2022/11/22
- [elpa] externals/exwm 1aa4ca781d 3/8: Support for killing the X terminal, ELPA Syncer, 2022/11/22
- [elpa] externals/exwm d6f62ff55a 6/8: Check EXWM terminal instead of client or graphical frames, ELPA Syncer, 2022/11/22