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
;; Left and top are always processed first.
(`left
(setq delta (- x size))
(when (and (< delta 0)
(setq delta (- size x))
(when (and (< 0 delta)
(or (not position)
(< (max beg y)
(min end (+ y height)))))
(cl-incf width delta)
(cl-decf width delta)
(setf x size)))
(`right
(setq delta (- root-width x width size))
(when (and (< delta 0)
(setq delta (- size (- root-width x width)))
(when (and (< 0 delta)
(or (not position)
(< (max beg y)
(min end (+ y height)))))
(cl-incf width delta)))
(cl-decf width delta)))
(`top
(setq delta (- y size))
(when (and (< delta 0)
(setq delta (- size y))
(when (and (< 0 delta)
(or (not position)
(< (max beg x)
(min end (+ x width))))
(< size (+ y height))
(> size y))
(cl-incf height delta)
(cl-decf height delta)
(setf y size)))
(`bottom
(setq delta (- root-height y height size))
(when (and (< delta 0)
(setq delta (- size (- root-height y height)))
(when (and (< 0 delta)
(or (not position)
(< (max beg x)
(min end (+ x width))))
(< (- root-height size)
(+ y height))
(> (- root-height size) y))
(cl-incf height delta))))))))
(cl-decf height delta))))))))
;; Save the result.
(setq exwm-workspace--workareas workareas)
(xcb:flush exwm--connection))