Home » Questions » Computers [ Ask a new question ]

Is there a way to move the current window to another desktop without using a mouse in OS X?

Is there a way to move the current window to another desktop without using a mouse in OS X?

In OS X as I'm aware to move the current window to the next desktop, I'd click down on the title bar of the window to have it in move mode, and then while keeping the mouse button down, press Ctrl+← or Ctrl+→. If you don't have a laptop, this may require three hands. Alternatively you can go into spaces and drag a window from one desktop to another.

Asked by: Guest | Views: 74
Total answers/comments: 4
Guest [Entry]

"If you install ""BetterTouchTool"", you can create a keyboard/mouse/gesture shortcut to either:

move application window to the other monitor,
maximize application window to the other monitor.

Works really well! Plus, ""BetterTouchTool"" has tons of other nifty features that you may find useful. It's free."
Guest [Entry]

It seems like Amethyst (github.com/ianyh/Amethyst) could switch application to any workspace.
Guest [Entry]

"This is not a solution, but it explains why it's not easy to find apps that support moving windows between spaces.

According to the developer of the open source Rectangles App, a keyboard-based window organizer, ""Apple doesn't provide public APIs for Spaces. If at some point they do, I'll be glad to to revisit this [feature request].""

Apps that do provide this feature use a private API of Apple's, which is not supported or documented by Apple. Amethyst is an open source app that supports the feature (mentioned in another answer). If you're curious, it seems the code that performs moves a window from one space to another is in Window.swift:

// A method of Window:
final class AXWindowID: Hashable, Codable {
// ...
func move(toSpace spaceID: CGSSpaceID) {
let currentSpace = CGSGetActiveSpace(CGSMainConnectionID())
let ids = [cgID()]
CGSRemoveWindowsFromSpaces(CGSMainConnectionID(), ids as CFArray, [currentSpace] as CFArray)
CGSAddWindowsToSpaces(CGSMainConnectionID(), ids as CFArray, [spaceID] as CFArray)

if UserConfiguration.shared.followWindowsThrownBetweenSpaces() {
focus()
}
}
}"
Guest [Entry]

There is a tool called Zooom that will allow you to grab any part of a window to move it using a hotkey, and also similarly resize windows, again with a hotkey. This is very nice when moving from a linux wm to OS X, however I'm still wondering if just basic switching as in the question is available without additional software purchases.