From 937da8645820ca5abee032c523cc2c72c6ce35e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Fri, 9 Jun 2023 00:00:00 +0000 Subject: [PATCH] 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. --- exwm-workspace.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/exwm-workspace.el b/exwm-workspace.el index 1bdc724..490d83a 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -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))