mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-30 14:38:00 +01:00
Leave `client' frame parameter in place
EXWM removed the `client' frame parameter from workspace frames, perhaps in order to lead Emacs to ask for confirmation before quitting. This change leaves the `client' frame parameter in place. Emacs no longer asks for confirmation when killing the emacsclient session. A followup commit will correct this. * exwm-workspace.el (exwm-workspace--add-frame-as-workspace) (exwm-workspace--init-minibuffer-frame, exwm-workspace--init) (exwm-workspace--exit, exwm-workspace--post-init): Remove special handling for `client' frames. They become workspaces just like any other frame.
This commit is contained in:
parent
1aa4ca781d
commit
ca7623349e
1 changed files with 7 additions and 40 deletions
|
@ -85,9 +85,6 @@ each time."
|
||||||
|
|
||||||
If the minibuffer is detached, this value is 0.")
|
If the minibuffer is detached, this value is 0.")
|
||||||
|
|
||||||
(defvar exwm-workspace--client nil
|
|
||||||
"The 'client' frame parameter of emacsclient frames.")
|
|
||||||
|
|
||||||
(defvar exwm-workspace--create-silently nil
|
(defvar exwm-workspace--create-silently nil
|
||||||
"When non-nil workspaces are created in the background (not switched to).
|
"When non-nil workspaces are created in the background (not switched to).
|
||||||
|
|
||||||
|
@ -1329,8 +1326,6 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(set-frame-parameter frame 'exwm-outer-id outer-id)
|
(set-frame-parameter frame 'exwm-outer-id outer-id)
|
||||||
(set-frame-parameter frame 'exwm-id window-id)
|
(set-frame-parameter frame 'exwm-id window-id)
|
||||||
(set-frame-parameter frame 'exwm-container container)
|
(set-frame-parameter frame 'exwm-container container)
|
||||||
;; In case it's created by emacsclient.
|
|
||||||
(set-frame-parameter frame 'client nil)
|
|
||||||
;; Copy RandR frame parameters from the first workspace to
|
;; Copy RandR frame parameters from the first workspace to
|
||||||
;; prevent potential problems. The values do not matter here as
|
;; prevent potential problems. The values do not matter here as
|
||||||
;; they'll be updated by the RandR module later.
|
;; they'll be updated by the RandR module later.
|
||||||
|
@ -1541,8 +1536,7 @@ applied to all subsequently created X frames."
|
||||||
(setq exwm-workspace--minibuffer
|
(setq exwm-workspace--minibuffer
|
||||||
(make-frame '((window-system . x) (minibuffer . only)
|
(make-frame '((window-system . x) (minibuffer . only)
|
||||||
(left . 10000) (right . 10000)
|
(left . 10000) (right . 10000)
|
||||||
(width . 1) (height . 1)
|
(width . 1) (height . 1))))
|
||||||
(client . nil))))
|
|
||||||
;; This is the only usable minibuffer frame.
|
;; This is the only usable minibuffer frame.
|
||||||
(setq default-minibuffer-frame exwm-workspace--minibuffer)
|
(setq default-minibuffer-frame exwm-workspace--minibuffer)
|
||||||
(exwm-workspace--modify-all-x-frames-parameters
|
(exwm-workspace--modify-all-x-frames-parameters
|
||||||
|
@ -1648,33 +1642,22 @@ applied to all subsequently created X frames."
|
||||||
(dolist (i initial-workspaces)
|
(dolist (i initial-workspaces)
|
||||||
(unless (frame-parameter i 'window-id)
|
(unless (frame-parameter i 'window-id)
|
||||||
(setq initial-workspaces (delq i initial-workspaces))))
|
(setq initial-workspaces (delq i initial-workspaces))))
|
||||||
(setq exwm-workspace--client
|
|
||||||
(frame-parameter (car initial-workspaces) 'client))
|
|
||||||
(let ((f (car initial-workspaces)))
|
(let ((f (car initial-workspaces)))
|
||||||
;; Remove the possible internal border.
|
;; Remove the possible internal border.
|
||||||
(set-frame-parameter f 'internal-border-width 0)
|
(set-frame-parameter f 'internal-border-width 0)))
|
||||||
;; Prevent user from deleting the first frame by accident.
|
|
||||||
(set-frame-parameter f 'client nil)))
|
|
||||||
(exwm-workspace--init-minibuffer-frame)
|
(exwm-workspace--init-minibuffer-frame)
|
||||||
;; Remove/hide existing frames.
|
;; Remove/hide existing frames.
|
||||||
(dolist (f initial-workspaces)
|
(dolist (f initial-workspaces)
|
||||||
(if (frame-parameter f 'client)
|
|
||||||
(progn
|
|
||||||
(unless exwm-workspace--client
|
|
||||||
(setq exwm-workspace--client (frame-parameter f 'client)))
|
|
||||||
(make-frame-invisible f))
|
|
||||||
(when (eq 'x (framep f)) ;do not delete the initial frame.
|
(when (eq 'x (framep f)) ;do not delete the initial frame.
|
||||||
(delete-frame f))))
|
(delete-frame f)))
|
||||||
;; Recreate one frame with the external minibuffer set.
|
;; Recreate one frame with the external minibuffer set.
|
||||||
(setq initial-workspaces (list (make-frame '((window-system . x)
|
(setq initial-workspaces (list (make-frame '((window-system . x))))))
|
||||||
(client . nil))))))
|
|
||||||
;; Prevent `other-buffer' from selecting already displayed EXWM buffers.
|
;; Prevent `other-buffer' from selecting already displayed EXWM buffers.
|
||||||
(modify-all-frames-parameters
|
(modify-all-frames-parameters
|
||||||
'((buffer-predicate . exwm-layout--other-buffer-predicate)))
|
'((buffer-predicate . exwm-layout--other-buffer-predicate)))
|
||||||
;; Create remaining workspaces.
|
;; Create remaining workspaces.
|
||||||
(dotimes (_ (- exwm-workspace-number (length initial-workspaces)))
|
(dotimes (_ (- exwm-workspace-number (length initial-workspaces)))
|
||||||
(nconc initial-workspaces (list (make-frame '((window-system . x)
|
(nconc initial-workspaces (list (make-frame '((window-system . x))))))
|
||||||
(client . nil))))))
|
|
||||||
;; Configure workspaces
|
;; Configure workspaces
|
||||||
(let ((exwm-workspace--create-silently t))
|
(let ((exwm-workspace--create-silently t))
|
||||||
(dolist (i initial-workspaces)
|
(dolist (i initial-workspaces)
|
||||||
|
@ -1730,29 +1713,13 @@ applied to all subsequently created X frames."
|
||||||
(exwm-container . nil)
|
(exwm-container . nil)
|
||||||
;; (internal-border-width . nil) ; integerp
|
;; (internal-border-width . nil) ; integerp
|
||||||
(fullscreen . nil)
|
(fullscreen . nil)
|
||||||
(buffer-predicate . nil)))
|
(buffer-predicate . nil)))))
|
||||||
;; Restore the 'client' frame parameter (before `exwm-exit').
|
|
||||||
(when exwm-workspace--client
|
|
||||||
(set-frame-parameter f 'client exwm-workspace--client))))
|
|
||||||
;; Restore the 'client' frame parameter (before `exwm-exit').
|
|
||||||
(when exwm-workspace--client
|
|
||||||
(when (and exwm-workspace--minibuffer-own-frame-p
|
|
||||||
(frame-live-p exwm-workspace--minibuffer))
|
|
||||||
(set-frame-parameter exwm-workspace--minibuffer 'client
|
|
||||||
exwm-workspace--client))
|
|
||||||
(setq exwm-workspace--client nil))
|
|
||||||
;; Don't let dead frames linger.
|
;; Don't let dead frames linger.
|
||||||
(setq exwm-workspace--list nil))
|
(setq exwm-workspace--list nil))
|
||||||
|
|
||||||
(defun exwm-workspace--post-init ()
|
(defun exwm-workspace--post-init ()
|
||||||
"The second stage in the initialization of the workspace module."
|
"The second stage in the initialization of the workspace module."
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
(when exwm-workspace--client
|
|
||||||
;; Reset the 'fullscreen' frame parameter to make emacsclinet frames
|
|
||||||
;; fullscreen (even without the RandR module enabled).
|
|
||||||
(dolist (i exwm-workspace--list)
|
|
||||||
(set-frame-parameter i 'fullscreen nil)
|
|
||||||
(set-frame-parameter i 'fullscreen 'fullboth)))
|
|
||||||
;; Wait until all workspace frames are resized.
|
;; Wait until all workspace frames are resized.
|
||||||
(with-timeout (1)
|
(with-timeout (1)
|
||||||
(while (< exwm-workspace--fullscreen-frame-count (exwm-workspace--count))
|
(while (< exwm-workspace--fullscreen-frame-count (exwm-workspace--count))
|
||||||
|
|
Loading…
Reference in a new issue