Skip to content
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

hs.spaces.moveWindowToSpace does not work on macOS 15.0 Sequoia #3698

Open
RichDom2185 opened this issue Oct 6, 2024 · 7 comments
Open

hs.spaces.moveWindowToSpace does not work on macOS 15.0 Sequoia #3698

RichDom2185 opened this issue Oct 6, 2024 · 7 comments

Comments

@RichDom2185
Copy link

image

It simply returns true without actually moving the window.

@QuantumLibet
Copy link

It does, if that happens to be the number of the current space. Otherwise it should output
nil target space ID 3 does not refer to a user space.

On x86 Sonoma 14.7:
Showing all available spaces hs.spaces.allSpaces() outputs smth like this for me:
["3A6BED5A-AB1C-8E9F-E898-3B421BF1F35B"] = { 1, 81, 83 }.
So the second space has the id 81 on my current installation.

Using hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 81) moves the window, to the second space (while I am on the first) and outputs true. Works as designed.

What OS version are you on?

@benjaminv
Copy link

I can replicate the issue on my OS Sequoia 15.0.1 (24A348)
I've tried both shortcut and cli to move a focused window from Id 1 to Id2. The window blinked and remains without really going to desktop id 2.

Logs are,

2024-10-07 11:29:53: -- Lazy extension loading enabled
2024-10-07 11:29:53: -- Loading ~/.hammerspoon/init.lua
2024-10-07 11:29:53: -- Loading extension: logger
2024-10-07 11:29:53: -- Loading extension: hotkey
2024-10-07 11:29:53: 11:29:53     hotkey: Enabled hotkey ⌃⇧1
2024-10-07 11:29:53:              hotkey: Enabled hotkey ⌃⇧2
2024-10-07 11:29:53:              hotkey: Enabled hotkey ⌃⇧3
2024-10-07 11:29:53:              hotkey: Enabled hotkey ⌃⇧4
2024-10-07 11:29:53:              hotkey: Enabled hotkey ⌃⇧5
2024-10-07 11:29:53:              hotkey: Enabled hotkey ⌃⇧6
2024-10-07 11:29:53: -- Done.
2024-10-07 11:30:04: 11:30:04 WindowMove: Hotkey pressed: ctrl + shift + 2
2024-10-07 11:30:04:          WindowMove: Attempting to move window to Desktop 2
2024-10-07 11:30:04: -- Loading extension: spaces
2024-10-07 11:30:04: -- Loading extension: application
2024-10-07 11:30:04:          WindowMove: UUID: 1D51D562-4807-ABEA-57D3-DF5D9BD2EFF9
2024-10-07 11:30:04:          WindowMove: Index: 1, Name: Desktop 1
2024-10-07 11:30:04:          WindowMove: Index: 2, Name: Desktop 2
2024-10-07 11:30:04:          WindowMove: Found spaceId for Desktop 2: 2
2024-10-07 11:30:04: -- Loading extension: window
2024-10-07 11:30:04:          WindowMove: Moving window hs.spaces.moveWindowToSpace does not work on macOS 15.0 Sequoia · Issue #3698 · Hammerspoon/hammerspoon - Google Chrome – Ben (Personal) to spaceId 2
2024-10-07 11:30:07: 11:30:07 WindowMove: Hotkey pressed: ctrl + shift + 3
2024-10-07 11:30:07:          WindowMove: Attempting to move window to Desktop 3
2024-10-07 11:30:07:          WindowMove: UUID: 1D51D562-4807-ABEA-57D3-DF5D9BD2EFF9
2024-10-07 11:30:07:          WindowMove: Index: 1, Name: Desktop 1
2024-10-07 11:30:07:          WindowMove: Index: 2, Name: Desktop 2
2024-10-07 11:30:07:          WindowMove: UUID: 7985EF1E-B2B7-C0CF-BC29-0CD90FBCB3D8
2024-10-07 11:30:07:          WindowMove: Index: 1, Name: Desktop 1
2024-10-07 11:30:07:          WindowMove: Index: 2, Name: Desktop 2
2024-10-07 11:30:07: 11:30:07 ** Warning:WindowMove: Space not found: Desktop 3
2024-10-07 11:30:07: 11:30:07 ** Warning:WindowMove: Space not found: Desktop 3
2024-10-07 11:30:07: -- Loading extension: alert
2024-10-07 11:30:10: 11:30:10 WindowMove: Hotkey pressed: ctrl + shift + 1
2024-10-07 11:30:10:          WindowMove: Attempting to move window to Desktop 1
2024-10-07 11:30:10:          WindowMove: UUID: 1D51D562-4807-ABEA-57D3-DF5D9BD2EFF9
2024-10-07 11:30:10:          WindowMove: Index: 1, Name: Desktop 1
2024-10-07 11:30:10:          WindowMove: Found spaceId for Desktop 1: 1
2024-10-07 11:30:10:          WindowMove: Moving window hs.spaces.moveWindowToSpace does not work on macOS 15.0 Sequoia · Issue #3698 · Hammerspoon/hammerspoon - Google Chrome – Ben (Personal) to spaceId 1

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 2)
true

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 3)
nil	target space ID 3 does not refer to a user space

@RichDom2185
Copy link
Author

What OS version are you on?

I am currently on 15.0.1 Sequoia but the issue happens since 15.0 (as per the title).

Sorry if my logs weren't clear enough. Regardless of whether I was moving it to the current space or not, it will always return true. In the following example, I was always in the first space:

2024-10-07 09:37:36: Welcome to the Hammerspoon Console!
You can run any Lua code in here.

2024-10-07 09:37:36: -- Lazy extension loading enabled
2024-10-07 09:37:36: -- Loading ~/.hammerspoon/init.lua
2024-10-07 09:37:36: -- Loading extension: hotkey
2024-10-07 09:37:36: 09:37:36     hotkey: Enabled hotkey ⌘⌃⌥W
2024-10-07 09:37:36: -- Done.
2024-10-07 09:38:18: -- Loading extension: spaces

> hs.spaces.allSpaces()
{
  ["37D8832A-2D66-02CA-B9F7-8F30A301B230"] = { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
}
2024-10-07 09:38:31: -- Loading extension: window

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 5)
true

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 6)
true

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 6)
true

> hs.spaces.moveWindowToSpace(hs.window.focusedWindow(), 5)
true

@krykra7
Copy link

krykra7 commented Oct 11, 2024

I can confirm the same behavior, it is always returning true, still nothing happens. It started after upgrading to Sequoia.

> hs.spaces.moveWindowToSpace(hs.application.get("kitty"):mainWindow(), hs.spaces.focusedSpace())
true

@marcelja
Copy link

They discussed here already. It seems like there's no good option to make it work
#3636

@RichDom2185
Copy link
Author

They discussed here already. It seems like there's no good option to make it work #3636

@marcelja Thanks for bringing this to my attention! The comment here #3636 (comment) seems to have done the trick for me.

@krykra7
Copy link

krykra7 commented Oct 17, 2024

I tried to modify provided script to suit my needs, namely moving unfocused window to current space, hack is not sufficient for this behavior, for me it's still open issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants