-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Same is true for attempting to move up when already at the top: the frame will jump to the bottom.
This is the case because hycontrol-move-frame does not ensure that X and Y are positive when passed to set-frame-position, and set-frame-position interprets negative X or negative Y as the right-most edge or top-most edge.
I have the following advice which fixes it, but it does that by replacing the entire function:
(define-advice hycontrol-move-frame
(:override (arrow pixels &rest r) ensure-positive-position)
"Ensure the position passed to `set-frame-position' is positive."
(let ((x (car (frame-position)))
(y (cdr (frame-position))))
(pcase arrow
('up (set-frame-position nil x (max 0 (- y pixels))))
('down (set-frame-position nil x (max 0 (+ y pixels))))
('left (set-frame-position nil (max 0 (- x pixels)) y))
('right (set-frame-position nil (max 0 (+ x pixels)) y)))))This ensure that x and y can't go below 0. I imagine that isn't needed for moving right or down, but I added it there anyway.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels