hammerspoon icon indicating copy to clipboard operation
hammerspoon copied to clipboard

Unable to move window to another space

Open susonthapa opened this issue 3 years ago • 1 comments

I have a key binding to move the current focused window to the next space but it's not working. Here is the code.

hs.hotkey.bind({'ctrl', 'alt'}, 'l', function()
	local fw = hs.window.focusedWindow()
	fw:moveOneScreenEast()
end)

I can verify that the function is called but nothing happens and there is nothing in the logs. Can anyone help me? Also is there any options in the hammerspoon to reduce the drag and release delay issue posted here.

Hammerspoon version: 0.9.82 Mac OS: 11.2

susonthapa avatar Feb 06 '21 11:02 susonthapa

Just to be clear, those set of functions moves a window across screens as in displays/monitors, not macOS virtual spaces.

That said, try explicitly passing in parameters: hs.window.focusedWindow():moveOneScreenWest(true, true)

Haven't dug into the root issue, but seems to make a difference for me even though the inline docs say they're optional.

--- Parameters:
---  * noResize - (optional) if `true`, maintain the window's absolute size
---  * ensureInScreenBounds - (optional) if `true`, use `setFrameInScreenBounds()` to ensure the resulting window frame is fully contained within
---    the window's screen

My hypothesis is that it's failing silently without the setFrameInScreenBounds() as my setup has both portrait and landscape screens/displays.

codeanpeace avatar Apr 04 '22 04:04 codeanpeace