Skip to content

Inconsistency with moveOneScreenEast/West #3739

@justin-pierce

Description

@justin-pierce

Image

This is my monitor layout -- the right one is an odd shaped vertical monitor, but I'm pretty sure I had similar issues with regular vertical monitors in the past (no longer have them to test with).

-- move focused window to next monitor
hs.hotkey.bind({"ctrl"}, "Right", function()
    local win = hs.window.focusedWindow()
    win:moveOneScreenEast(false, true, 0)
end)

-- move focused window to previous monitor
hs.hotkey.bind({"ctrl"}, "Left", function()
    local win = hs.window.focusedWindow()
    win:moveOneScreenWest(false, true, 0)
end)

(to use these bindings, you'll need to unbind launch pad shortcuts, so you might want to instead test with different bindings)

When moving a maximized window to the vertical monitor, it will not properly adjust to maximize on the vertical monitor -- it leaves a gap at the bottom. If I move the window back to the horizontal monitor, it retains the gap proportionally (expected).

Image

If I change the layout to align the tops of both monitors, it makes the gap more pronounced (gap size seems to be correlated with how much the vertical monitor extends below the horizontal monitor).

Image

If I change the layout so that the bottoms align, it seems to fix it for maximized windows -- no gap. Not really a solution to the problem though.

Additionally, regardless of layout, windows that are not maximized get slightly shorter each time they move over. If you do it repeatedly you can see the gap getting larger.

Setting ensureInScreenBounds to false doesn't seem to help any.

This is on Hammerspoon 1.0.0 macOS 15.2, though I'm pretty sure this behavior happened, at least sometimes, on older versions of both Hammerspoon and macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions