kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

space(i).moveWindows([x]) seems to no longer work under Sonoma 14.5 #348

Closed l00sed closed 2 months ago

l00sed commented 3 months ago

Example: space(i).moveWindows([ACTIVE_WINDOW])

I think Sonoma 14.5 had some big GUI engine updates, so it's likely related to this upgrade. Not seeing any errors in the Phoenix logs. It finds the active window and the space.

I am seeing:

2024-05-15 12:02:04.787165-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x60000167afa0> {pid=33874}. (-25205)
2024-05-15 12:02:04.868653-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x60000167b2a0> {pid=33874}. (-25205)
2024-05-15 12:02:04.914860-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x60000165b000> {pid=33874}. (-25205)
2024-05-15 12:02:06.312426-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x600001653c60> {pid=33874}. (-25205)
2024-05-15 12:02:19.402839-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x60000165a940> {pid=33874}. (-25205)
2024-05-15 12:02:19.464484-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x60000167f840> {pid=33874}. (-25205)
2024-05-15 12:02:19.507296-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x600001604060> {pid=33874}. (-25205)
2024-05-15 12:02:21.153676-0400 0x238d7    Default     0x0                  26641  0    Phoenix: Info: Could not get value for attribute “AXWindow” from element <AXUIElement 0x600001679da0> {pid=33874}. (-25205)

... which may be related to the problem?

disperse commented 3 months ago

Having the same issue, also with Sonoma 14.5. (throwing windows to spaces with Amethyst also broke in the same timeframe so this may be related) I have a few more warnings in my Phoenix log:

2024-05-17 11:45:45.313390-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not remove notification “AXWindowCreated” for element <AXUIElement Application 0x60000365c2a0> {pid=94360}. (-25204)
2024-05-17 11:43:13.720438-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXUIElementDestroyed” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
2024-05-17 11:43:13.720749-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXFocusedWindowChanged” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
2024-05-17 11:43:13.721051-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXWindowMoved” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
2024-05-17 11:43:13.721370-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXWindowResized” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
2024-05-17 11:43:13.721641-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXWindowMiniaturized” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
2024-05-17 11:43:13.722088-0400 0x4844f2   Default     0x0                  92379  0    Phoenix: Info: Could not add notification “AXWindowDeminiaturized” for element <AXUIElement Application 0x60000369a850> {pid=92180}. (-25204)
kasper commented 3 months ago

Hey! Thanks for the report. I guess I need to start digging what private API changes have caused this.

rohm1 commented 3 months ago

Issue does not seem specific to phoenix, yabai released a fix, maybe this helps: https://github.com/koekeishiya/yabai/issues/2240

kasper commented 3 months ago

Also being discussed here: https://github.com/ianyh/Amethyst/issues/1643. Unfortunately, I’m not sure how long we will be able to keep the Spaces support if Apple is starting to protect these private APIs.

l00sed commented 3 months ago

Kudos to you and other OSS contributors for keeping it up. This is definitely distressing. If I knew anything about Mac development I'd try to help. Maybe some day.

Would be super sad if Apple made that restricted, especially for people on company laptops who can't disable SIP to get additional access.

metakirby5 commented 3 months ago

This interfered with my daily workflow enough that I adopted the fix from yabai and Amethyst myself 😅 And it seems to work!

https://github.com/kasper/phoenix/pull/350

purag commented 3 months ago

This is for sure one of my most used features, would love if we could merge @metakirby5's fix!

kasper commented 2 months ago

@metakirby5 Awesome, thanks! Added some comments to the PR.

kasper commented 2 months ago

Hey everyone! The fix is now released in 4.0.1.

purag commented 2 months ago

Fantastic, it's working again! Thanks @metakirby5 and @kasper!

dan-phantom commented 2 months ago

This PR doesn't fully work, in my case it moves the window offscreen instead of to the right screen (if it needs to change the screens) As for spaces it doesn't move the window to the right space anymore (if the window should stay on the same screen but a different space)

Thanks for making this utility ❤️

kasper commented 1 month ago

@dan-phantom #351 for the multi-monitor regression.