mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-23 19:47:58 +01:00
Fix workspace height unsharing workarea value
* exwm-workspace.el (exwm-workspace--update-workareas): Clone the value of the `exwm-geometry' frame parameter before modifying it for calculating workareas. (exwm-workspace--update-workareas): Simplify `pcase' patterns.
This commit is contained in:
parent
381637aa1c
commit
8cab6c03fa
1 changed files with 18 additions and 16 deletions
|
@ -345,18 +345,20 @@ Show PROMPT to the user if non-nil."
|
||||||
(let* ((root-width (x-display-pixel-width))
|
(let* ((root-width (x-display-pixel-width))
|
||||||
(root-height (x-display-pixel-height))
|
(root-height (x-display-pixel-height))
|
||||||
;; Get workareas prior to struts.
|
;; Get workareas prior to struts.
|
||||||
(workareas (mapcar (lambda (f)
|
(workareas (mapcar
|
||||||
(or
|
(lambda (frame)
|
||||||
;; Use the 'exwm-geometry' frame parameter if
|
(if-let (rect (frame-parameter frame 'exwm-geometry))
|
||||||
;; possible.
|
;; Use the 'exwm-geometry' frame parameter if it
|
||||||
(frame-parameter f 'exwm-geometry)
|
;; exists. Make sure to clone it, will be modified
|
||||||
;; Fall back to use the screen size.
|
;; below!
|
||||||
(make-instance 'xcb:RECTANGLE
|
(clone rect)
|
||||||
:x 0
|
;; Fall back to use the screen size.
|
||||||
:y 0
|
(make-instance 'xcb:RECTANGLE
|
||||||
:width root-width
|
:x 0
|
||||||
:height root-height)))
|
:y 0
|
||||||
exwm-workspace--list)))
|
:width root-width
|
||||||
|
:height root-height)))
|
||||||
|
exwm-workspace--list)))
|
||||||
;; Exclude areas occupied by struts.
|
;; Exclude areas occupied by struts.
|
||||||
(dolist (struts exwm-workspace--struts)
|
(dolist (struts exwm-workspace--struts)
|
||||||
(let* ((edge (aref struts 0))
|
(let* ((edge (aref struts 0))
|
||||||
|
@ -369,7 +371,7 @@ Show PROMPT to the user if non-nil."
|
||||||
(with-slots (x y width height) w
|
(with-slots (x y width height) w
|
||||||
(pcase edge
|
(pcase edge
|
||||||
;; Left and top are always processed first.
|
;; Left and top are always processed first.
|
||||||
(`left
|
('left
|
||||||
(setq delta (- size x))
|
(setq delta (- size x))
|
||||||
(when (and (< 0 delta)
|
(when (and (< 0 delta)
|
||||||
(< delta width)
|
(< delta width)
|
||||||
|
@ -378,7 +380,7 @@ Show PROMPT to the user if non-nil."
|
||||||
(min end (+ y height)))))
|
(min end (+ y height)))))
|
||||||
(cl-decf width delta)
|
(cl-decf width delta)
|
||||||
(setf x size)))
|
(setf x size)))
|
||||||
(`right
|
('right
|
||||||
(setq delta (- size (- root-width x width)))
|
(setq delta (- size (- root-width x width)))
|
||||||
(when (and (< 0 delta)
|
(when (and (< 0 delta)
|
||||||
(< delta width)
|
(< delta width)
|
||||||
|
@ -386,7 +388,7 @@ Show PROMPT to the user if non-nil."
|
||||||
(< (max beg y)
|
(< (max beg y)
|
||||||
(min end (+ y height)))))
|
(min end (+ y height)))))
|
||||||
(cl-decf width delta)))
|
(cl-decf width delta)))
|
||||||
(`top
|
('top
|
||||||
(setq delta (- size y))
|
(setq delta (- size y))
|
||||||
(when (and (< 0 delta)
|
(when (and (< 0 delta)
|
||||||
(< delta height)
|
(< delta height)
|
||||||
|
@ -395,7 +397,7 @@ Show PROMPT to the user if non-nil."
|
||||||
(min end (+ x width)))))
|
(min end (+ x width)))))
|
||||||
(cl-decf height delta)
|
(cl-decf height delta)
|
||||||
(setf y size)))
|
(setf y size)))
|
||||||
(`bottom
|
('bottom
|
||||||
(setq delta (- size (- root-height y height)))
|
(setq delta (- size (- root-height y height)))
|
||||||
(when (and (< 0 delta)
|
(when (and (< 0 delta)
|
||||||
(< delta height)
|
(< delta height)
|
||||||
|
|
Loading…
Reference in a new issue