mirror of
https://github.com/emacs-exwm/exwm.git
synced 2025-01-23 00:18:00 +01:00
Adapt dynamic workspace for floating module
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace): Fix the checking criteria of floating frames; Copy RandR frame parameters from the first workspace frame (rather than the selected one which can be a floating frame). * exwm-workspace.el (exwm-workspace--remove-frame-as-workspace): Check frame type first.
This commit is contained in:
parent
622618ac6e
commit
4c9afc25b3
1 changed files with 13 additions and 7 deletions
|
@ -981,7 +981,10 @@ INDEX must not exceed the current number of workspaces."
|
||||||
frame
|
frame
|
||||||
(frame-parameter frame 'display)
|
(frame-parameter frame 'display)
|
||||||
(slot-value exwm--connection 'display)))
|
(slot-value exwm--connection 'display)))
|
||||||
((frame-parameter frame 'exwm-floating)
|
((frame-parameter frame 'unsplittable)
|
||||||
|
;; We create floating frames with the "unsplittable" parameter set.
|
||||||
|
;; Though it may not be a floating frame, we won't treat an
|
||||||
|
;; unsplittable frame as a workspace anyway.
|
||||||
(exwm--log "Frame `%s' is floating" frame))
|
(exwm--log "Frame `%s' is floating" frame))
|
||||||
(t
|
(t
|
||||||
(exwm--log "Adding frame `%s' as workspace" frame)
|
(exwm--log "Adding frame `%s' as workspace" frame)
|
||||||
|
@ -995,12 +998,13 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(set-frame-parameter frame 'exwm-outer-id outer-id)
|
(set-frame-parameter frame 'exwm-outer-id outer-id)
|
||||||
(set-frame-parameter frame 'exwm-container container)
|
(set-frame-parameter frame 'exwm-container container)
|
||||||
(set-frame-parameter frame 'exwm-workspace workspace)
|
(set-frame-parameter frame 'exwm-workspace workspace)
|
||||||
;; Use same RandR output and geometry as previous workspace.
|
;; Copy RandR frame parameters from the first workspace to
|
||||||
(let ((prev-workspace (selected-frame)))
|
;; prevent potential problems. The values do not matter here as
|
||||||
|
;; they'll be updated by the RandR module later.
|
||||||
|
(let ((w (car exwm-workspace--list)))
|
||||||
(dolist (param '(exwm-randr-output
|
(dolist (param '(exwm-randr-output
|
||||||
exwm-geometry))
|
exwm-geometry))
|
||||||
(set-frame-parameter frame param
|
(set-frame-parameter frame param (frame-parameter w param))))
|
||||||
(frame-parameter prev-workspace param))))
|
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:CreateWindow
|
(make-instance 'xcb:CreateWindow
|
||||||
:depth 0 :wid workspace :parent exwm--root
|
:depth 0 :wid workspace :parent exwm--root
|
||||||
|
@ -1056,10 +1060,12 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(defun exwm-workspace--remove-frame-as-workspace (frame)
|
(defun exwm-workspace--remove-frame-as-workspace (frame)
|
||||||
"Stop treating frame FRAME as a workspace."
|
"Stop treating frame FRAME as a workspace."
|
||||||
(cond
|
(cond
|
||||||
((= 1 (exwm-workspace--count))
|
|
||||||
(exwm--log "Cannot remove last workspace"))
|
|
||||||
((not (exwm-workspace--workspace-p frame))
|
((not (exwm-workspace--workspace-p frame))
|
||||||
(exwm--log "Frame `%s' is not a workspace" frame))
|
(exwm--log "Frame `%s' is not a workspace" frame))
|
||||||
|
((= 1 (exwm-workspace--count))
|
||||||
|
;; FIXME: When using dedicated minibuffer frame, deleting the last
|
||||||
|
;; frame hangs Emacs.
|
||||||
|
(user-error "[EXWM] Cannot remove last workspace"))
|
||||||
(t
|
(t
|
||||||
(exwm--log "Removing frame `%s' as workspace" frame)
|
(exwm--log "Removing frame `%s' as workspace" frame)
|
||||||
(let* ((index (exwm-workspace--position frame))
|
(let* ((index (exwm-workspace--position frame))
|
||||||
|
|
Loading…
Reference in a new issue