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))