Convert `delta' to the size the strut occupies in the workarea

* exwm-workspace.el (exwm-workspace--update-workareas): Repurpose
`delta' to be the positive size occupied by the strut in the
workarea.
This commit is contained in:
Adrián Medraño Calvo 2023-06-09 00:00:00 +00:00
parent 67c5b316be
commit 937da86458

View file

@ -368,40 +368,40 @@ FRAME may be either a workspace frame or a workspace position."
(pcase edge (pcase edge
;; Left and top are always processed first. ;; Left and top are always processed first.
(`left (`left
(setq delta (- x size)) (setq delta (- size x))
(when (and (< delta 0) (when (and (< 0 delta)
(or (not position) (or (not position)
(< (max beg y) (< (max beg y)
(min end (+ y height))))) (min end (+ y height)))))
(cl-incf width delta) (cl-decf width delta)
(setf x size))) (setf x size)))
(`right (`right
(setq delta (- root-width x width size)) (setq delta (- size (- root-width x width)))
(when (and (< delta 0) (when (and (< 0 delta)
(or (not position) (or (not position)
(< (max beg y) (< (max beg y)
(min end (+ y height))))) (min end (+ y height)))))
(cl-incf width delta))) (cl-decf width delta)))
(`top (`top
(setq delta (- y size)) (setq delta (- size y))
(when (and (< delta 0) (when (and (< 0 delta)
(or (not position) (or (not position)
(< (max beg x) (< (max beg x)
(min end (+ x width)))) (min end (+ x width))))
(< size (+ y height)) (< size (+ y height))
(> size y)) (> size y))
(cl-incf height delta) (cl-decf height delta)
(setf y size))) (setf y size)))
(`bottom (`bottom
(setq delta (- root-height y height size)) (setq delta (- size (- root-height y height)))
(when (and (< delta 0) (when (and (< 0 delta)
(or (not position) (or (not position)
(< (max beg x) (< (max beg x)
(min end (+ x width)))) (min end (+ x width))))
(< (- root-height size) (< (- root-height size)
(+ y height)) (+ y height))
(> (- root-height size) y)) (> (- root-height size) y))
(cl-incf height delta)))))))) (cl-decf height delta))))))))
;; Save the result. ;; Save the result.
(setq exwm-workspace--workareas workareas) (setq exwm-workspace--workareas workareas)
(xcb:flush exwm--connection)) (xcb:flush exwm--connection))