-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Review] Fix moving window to space in Sonoma 14.5 #3638
Conversation
@cmsj the failure looks like a problem with the reporting? At any rate, unless I'm missing something I can ignore this I think... let me know if I'm wrong. |
When will this be merged? Can't wait to see the fixed version ! |
I wait this merge every day :) Thanks for you work! |
me too |
is this repo deprecated ? It hasn't been updated for quite a while... |
@nzhl - Definitely not deprecated, however, @cmsj (the maintainer) has been busy with other things, so sadly Hammerspoon hasn't been updated in a while. @asmagill - I could always build & sign locally and share a local build here if helpful? |
@latenitefilms please do share build. Because my build is failing to organise windows to spaces. Thanks! |
I have a build on my fork: https://github.com/gartnera/hammerspoon/releases/tag/0.10.0 Tested on MacOS Sonoma 14.5. |
I've been using the version packaged by @gartnera above. Although I can move windows across Spaces on the same screen without issue, moving windows across Spaces on different screens is not working (the window apparently gets moved but is not visible). I am considering the error might be in my Lua code calling the Hammerspoon API. Can anyone share Lua code that works when moving windows across Spaces on different screens so I can compare? |
I'm seeing similar issues to @cunha - moving a window to a space on a different screen results in the window being invisible. It appears that the cause is that the geometry of the window doesn't change, meaning that it's coordinates are still for the old screen. For now, I'm getting around this by calling window:moveToScreen in addition to calling moveWindowToSpace; I also have to add in a sleep of about a half a second between the two calls, or it ends up moving the window to the currently selected space on the screen containing the target space. That said, even with the workaround needed, a huge thanks to @asmagill for making this change. It has been driving me nuts since upgrading to 14.5 that I haven't been able to use hammer spoon to move windows around. Your change makes a significant improvement to my day! |
Yes i can confirm too. When i use multiple displays some windows that should appear in Mac book Built-in retina display appears hidden. Only "Window -> Move To Dell XXX" helps to "unhide" window |
Hi guys, I understand that open source project rely on the time available to maintainers, so I would be willing to help out on this one if required. I'm not fluent in Objective-C and Lua, but I'm willing to learn enough to unblock the situation (and I'm very familiar with Github workflows, so if that's the issue, I can help easily) What would allow this to move forward ? |
The current workaround is to use the build by gartnera, and then change the Lua code to show windows when they are moved to different screens (see discussion in the previous posts). For reference, this is how my Lua code looks at the moment (it's hacky, but beats moving windows with the mouse): local function MoveWindowToSpace(sp)
prefix.exit()
local win = hs.window.focusedWindow() -- current window
local screenID, spaceID = getScreenSpaceID(sp)
print("moving window to space " .. spaceID)
spaces.moveWindowToSpace(win:id(), spaceID)
win:focus() -- follow window to new space
-- MacOS takes focus from us. Get it f'ing back. This may cease to
-- be an issue after we choose to "Reduce motion" in
-- System preferences -> accessibility -> display.
-- cunha@20240409 it's still an issue
hs.timer.usleep(400000)
-- moveToScreen may not be necessary after Sonoma fix is merged:
-- https://github.com/Hammerspoon/hammerspoon/pull/3638#issuecomment-2209445157
win:moveToScreen(screenID)
win:focus()
end |
Hello @cunha , thank you for the workaround, I'll perhaps implement it if I don't have any other option (I'm trying to avoid installing fork or branch releases as much as possible on my work Mac) My question was probably unclear. What would it take to have this PR to be merged and delivered with the official Hammerspoon ? I understand @asmagill fix is the solution, and he did an amazing job at fixing it, I just want to help if I can with any impediment in the PR that would prevent its merge. |
I think the main bottleneck is that only @cmsj has the ability to push out a Hammerspoon release, and he's flat out with other things. |
Sorry everyone, I know this has been super annoying! |
Addresses #3636