about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2023-06-09T00·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2023-08-18T00·00+0000
commit937da8645820ca5abee032c523cc2c72c6ce35e2 (patch)
treefc7100dbb4898014ef890f9171108e441768a393
parent67c5b316be03eb639bd0cda838579af27bb577b4 (diff)
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.
-rw-r--r--exwm-workspace.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 1bdc7245aa6f..490d83acc5d8 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))