From 41914fb8b21172887d1a66b44d7304cb0ee1ba2b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 20 Aug 2017 19:46:12 +0100 Subject: [PATCH] Fix for moving Chrome and some other apps between spaces --- hammerspoon/window_management.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hammerspoon/window_management.lua b/hammerspoon/window_management.lua index 4f1442d..8c404e8 100644 --- a/hammerspoon/window_management.lua +++ b/hammerspoon/window_management.lua @@ -311,16 +311,20 @@ wm.resizeWindowOnGridSymmetrically = function (w, h) end -- moveWindowToSpace --- Requires ctrl+/ and ctrl+ system keybindings, borrowed from +--- +-- Requires ctrl+/ and ctrl+ system keybindings, originally +-- from: -- https://github.com/Hammerspoon/hammerspoon/issues/235#issuecomment-101069303 wm.moveWindowToSpace = function (direction) return function() local mouseOrigin = mouse.getAbsolutePosition() local win = hs.window.focusedWindow() + local app = win:application() local clickPoint = win:zoomButtonRect() + -- click and hold next to the zoom button close to the top of the window clickPoint.x = clickPoint.x + clickPoint.w + 5 - clickPoint.y = clickPoint.y + (clickPoint.h / 2) + clickPoint.y = win:frame().y + 7 local mouseClickEvent = hs.eventtap.event.newMouseEvent( hs.eventtap.event.types.leftMouseDown, clickPoint