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

Throwing application to another space is broken. #1643

Closed
JS211 opened this issue May 14, 2024 · 70 comments · Fixed by #1648
Closed

Throwing application to another space is broken. #1643

JS211 opened this issue May 14, 2024 · 70 comments · Fixed by #1648
Labels
Milestone

Comments

@JS211
Copy link

JS211 commented May 14, 2024

Describe the bug
Updated to Mac OS 14.5 which caused throwing applications to different spaces to stop working and crash amethyst v0.20. Updated to amethyst v0.21 and it no longer crashes but throwing apps to different spaces still doesn’t work.
Applications:
What applications are involved?
Any application

To Reproduce
Assign a shortcut to throw current application to space 1, 2, or 3.
Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

  • macOS: 14.5
  • Amethyst: 0.20, 0.21

Debug Info

$ /Applications/Amethyst.app/Contents/MacOS/Amethyst --debug-info [--include-apps]

Note: --include-apps will list your manageable applications, but is optional if you don't want to list that.

Additional context
Add any other context about the problem here.

@joshuaalderson
Copy link

joshuaalderson commented May 15, 2024

After updating to 14.5 I am also experiencing the same issue. 14 inch M3 MacBook, Amethyst Version 0.20.0 (108)

When trying to use the keyboard shortcut to send a window to another screen it sends it and then sends it back to the original display instantly. Interestingly moving the window with the trackpad to another display still seems to work however.

I've tried relaunching the Amethyst app, completely closing/quitting the app and opening again and still doesn't work. I've also tried different displays and have the same issue.

@ianyh
Copy link
Owner

ianyh commented May 15, 2024

Dang. I'll upgrade and give it a go. The APIs probably changed in some way.

@hpfmn
Copy link

hpfmn commented May 15, 2024

FYI: yabai has the same issue. I would also think that something about SkyLight did change. My problem is that I don’t know much about how this framework works. I guess SLSMoveWindowsToManagedSpace is our problem here. I think you use this function as well?

@dee-kryvenko
Copy link

Got the same problem. Interesting that if I have Amethyst disabled, the key combination still makes my screen flicker and the tab bar briefly change the title of the focused screen to something else, although it happens so quick that you can't really read it. I recorded it and in the recording I can see it changes to Finder and back.

@joshuaalderson
Copy link

joshuaalderson commented May 17, 2024

Just to add on to the above; when I disable Amethyst moving apps to different windows using the keyboard shortcut actually works? Perhaps this is obvious to others but I thought disabling Amethyst would disable this functionality. Of course the windows margin stuff doesn't work but at least for now I can get the keyboard shortcuts working to move app windows to different screens

@phrmendes
Copy link

Same problem here. Also, I believe that this issue is related to this bug.

@porkloin
Copy link

+1, I have one machine on 14.4.1 with no issues, another on 14.5 where I can no longer throw windows to other spaces, exact same config otherwise.

@porkloin
Copy link

FWIW, it seems like the yabai folks found a temporary solution: koekeishiya/yabai#2240 (comment)

Bad news is that it looks like the API change may require SIP to be disabled, which is a huge problem for people working on employer-owned hardware that can't be modified like that. 😬

@ianyh
Copy link
Owner

ianyh commented May 18, 2024

Yeah, I'm not particularly surprised, honestly. Seemed like a matter of time before the private APIs got locked down. If history is any indication, Apple will probably lock it down and then immediately launch their new tiling window manager, macOS Flow or something. 😂

I'll try to apply yabai's fix for now, and hope for the best.

@kolchurinvv
Copy link

Raycast's window management is still intact. throwing to next display and to next desktop works just fine somehow on 14.5

@Ryan-the-hito
Copy link

Raycast's window management is still intact. throwing to next display and to next desktop works just fine somehow on 14.5

For me, Raycast is also dead. It can only move its own Setting window but leaves other windows still.

@kolchurinvv
Copy link

kolchurinvv commented May 22, 2024

@Ryan-the-hito - i double checked and you're right. it was able to throw a focused window to the next display, but that could be related to the fact the the dock i'm using requires display link software. when unplugged from the dock raycast behaves exactly like you describe

@escherlies
Copy link

escherlies commented May 23, 2024

Same problem here. Also, I believe that this issue is related to this bug.

I think too, i noticed the thrown window looses focus which makes it broken.

Also FYI, I just rolled back to Amethyst v0.20.0 (108) and everything's working fine again.

EDIT: Still using MacOS 14.4.1

@svrdlans
Copy link

Also FYI, I just rolled back to Amethyst v0.20.0 (108) and everything's working fine again.

I tried going back to v0.20.0 on Sonoma 14.5, it allows me to throw window between screens (laptop - monitor), but doesn't seem to be aware of Spaces and can't throw window to different Spaces on the same screen

for now I drag-drop to specific Spaces ¯_(ツ)_/¯

@Ryan-the-hito
Copy link

@svrdlans I tried the latest BetterTouchTool and it is still working. I guess it uses a different way to send windows to different spaces. So now I am assigning the original shortcuts in the BetterTouchTool. 😀

@escherlies
Copy link

Also FYI, I just rolled back to Amethyst v0.20.0 (108) and everything's working fine again.

I tried going back to v0.20.0 on Sonoma 14.5, it allows me to throw window between screens (laptop - monitor), but doesn't seem to be aware of Spaces and can't throw window to different Spaces on the same screen

for now I drag-drop to specific Spaces ¯_(ツ)_/¯

Ah thanks for clarification!

I am still on 14.4.1... So I think I'll wait for the update 😅

@denisbr
Copy link

denisbr commented May 24, 2024

Apparently yabai was able to restore space throwing functionality?
koekeishiya/yabai#2240 (comment)

@HanSooloo
Copy link

On macOS 14.5 and after getting the 0.21 update lost ability to throw windows to spaces. When I used the shortcut key, the window flashes for a split second and doesn't move. Stays in the same screen.
When I reverted back to Amethyst 0.20, the flashing doesn't happen, but throwing to a space doesn't work either.

I wonder if this points to a macOS 14.4 ==> 14.5 issue.

@aleksozolins
Copy link

Friends it is broken for me as well. I hope for a fix soon but do not have the ability myself.

@Vinh-CHUC
Copy link

broken for me too! hoping for a fix too :)

@HanSooloo
Copy link

HanSooloo commented May 26, 2024 via email

@timvisher
Copy link
Contributor

Please don't comment with a 'broken for me too' message. That's what the 👍 button at the top of the issue is for. Thanks in advance!

@ianyh
Copy link
Owner

ianyh commented May 27, 2024

Implemented the fix, which functions on 14.4.1. Need to test on 14.5 still.

@tlpierce
Copy link

If you have Keyboard Maestro, you can use a macro to throw windows between desktops as a workaround. This is what I'm currently doing. I unmapped the "Throw focused window to space..." in Amethyst preferences and mapped the same keystroke to the appropriate macro in Keyboard Maestro.

@simonbernard-shopify
Copy link

simonbernard-shopify commented May 29, 2024

On Sonoma 14.5 and running Amethyst 0.21.0 (110) and I can't throw windows to other spaces. I can throw them to external monitors though.

Edit: Actually nevermind, downloading the latest patch from https://github.com/ianyh/Amethyst/releases fixed it. Thanks @ianyh!

@ja-versent
Copy link

@ianyh i don't have SIP disabled on my intel mac if that's the differentiator
i can try and get debug logs later to try illuminate the issue

@ianyh
Copy link
Owner

ianyh commented May 29, 2024

That's a good definitive datapoint thank you.

@claviola
Copy link

I also have access to a Mac on Intel and can try to repro later if you need more data.

@Cerebus
Copy link

Cerebus commented May 30, 2024

I suggest @ianyh lock this issue and direct over to #1655.

@RoyBolter
Copy link

I have updated to the macOS 15 beta and this problem has reoccured

@aystic
Copy link

aystic commented Aug 4, 2024

Still having this issue on MacOS Ventura 13.6.8 and Amethyst 0.21.1(111)

@harrysolovay
Copy link

As am I

@noel-yap
Copy link

noel-yap commented Aug 23, 2024

After getting a new laptop ~2 weeks ago and installing Amethyst, things worked fine (throwing to spaces stopped working on my previous laptop after updating the OS).

Today, after updating the OS on the new laptop, throwing to spaces stopped working. Uninstalling and reinstalling Amethyst didn't fix things although I noticed my previous settings were still there. I'm gonna try uninstalling and wiping out Amethyst settings then reinstalling.

@noel-yap
Copy link

Hmm, even after moving ~/Library/Application Support/Amethyst out of the way and reinstalling, my previous settings still stuck.

What's the best way to wipe out everything and start from scratch?

@noel-yap
Copy link

After brew install --cask amethyst, it's working for me now although it crashes when trying to throw the Amethyst preferences window.

https://ianyh.com/amethyst/ should be updated to download 0.21.1.

@OmriSama
Copy link

OmriSama commented Sep 2, 2024

Still not working for me... Shift+Control+Option+Command focuses my mouse on the window but doesn't actually throw it to any of the spaces. This is on Ventura 13.6.9.

@jcarlos7121
Copy link

I think this broke again with Mac OS Sequoia, does anybody getting this issue again?

@cgrindel
Copy link

This issue is very strange. I have one laptop that works and another that does not, both with the same OS. From what I can tell from the comments, it does not appear to be related to CPU architecture. However, in my case, the one that works is arm64, and the one that doesn't is x86_64.

@aystic
Copy link

aystic commented Sep 20, 2024

Issue fixed and working fine for Amethyst v0.21.2(112) on MacOS Ventura 13.7 (22H123)

@brunogimenez
Copy link

Not working on Sequoia, Amethyst v0.21.2 (112)

@OmriSama
Copy link

Issue fixed and working fine for Amethyst v0.21.2(112) on MacOS Ventura 13.7 (22H123)

Can confirm! Woo! Thanks :)

@lucadibello
Copy link

lucadibello commented Sep 21, 2024

Not working on Sequoia, Amethyst v0.21.2 (112)

Same here unfortunately using the same version: Amethyst v0.21.2 (112). Waiting for a fix.

@ianyh
Copy link
Owner

ianyh commented Sep 21, 2024

I don’t expect it to work at all on Sequoia. I’m not sure how to communicate it in-app, though.

@qmacro
Copy link

qmacro commented Sep 23, 2024

I don’t expect it to work at all on Sequoia

I'm on Sequoia now (not my choice) and am encountering this issue. But I wanted to say: whatever happens, thank you
@ianyh for such an awesome experience thus far. It must be frustrating with the API goalposts moving like this.

@timvisher
Copy link
Contributor

Here's the +1 comment for Sonoma 14.7/Amethyst 0.21.2 working! 🥳

@gkzhb
Copy link

gkzhb commented Oct 19, 2024

@tlpierce: If you have Keyboard Maestro, you can use a macro to throw windows between desktops as a workaround. This is what I'm currently doing. I unmapped the "Throw focused window to space..." in Amethyst preferences and mapped the same keystroke to the appropriate macro in Keyboard Maestro.

Great idea!
I'm using yabai and managed to implement this feature with Hammerspoon: just switch to the destination desktop space(with mission control shortcuts) while dragging the window you want to move.

-- Set up the logger
local log = hs.logger.new('WindowMover', 'info')

-- Convert seconds to microseconds
local timeUnit = 1000 * 1000
-- delay: in seconds
function asyncLeftClick(point, delay, onFinished)
  local module = hs.eventtap
  module.event.newMouseEvent(module.event.types["leftMouseDown"], point):post()

  hs.timer.doAfter(delay, function()
    module.event.newMouseEvent(module.event.types["leftMouseUp"], point):post()
    if onFinished then
      onFinished()
    end
  end)
end

-- Move window to space
function moveWindowToSpace(window, spaceNumber)
    log.i("Moving window " .. window:title() .. " to space " .. spaceNumber)
  local prevCursorPoint = hs.mouse.absolutePosition()
  local winFrame = window:frame()
  local point = hs.geometry(winFrame.x + 5, winFrame.y + 15)
  asyncLeftClick(point, 1, function()
    -- Restore cursor position
    hs.mouse.absolutePosition(prevCursorPoint)
  end)
  -- Switch to target space with Mission Control shortcuts
  if spaceNumber < 10 then
    hs.eventtap.keyStroke({ 'alt' }, tostring(spaceNumber), 0.2 * timeUnit)
  else
    hs.eventtap.keyStroke({ 'alt', 'ctrl' }, tostring(spaceNumber - 10), 0.2 * timeUnit)
  end
end

-- Function to move focused window to a specific space
function moveFocusedWindowToSpace(spaceNumber)
  local spaceName = "Desktop " .. spaceNumber
  log.i("Attempting to move window to " .. spaceName)
  local focusedWindow = hs.window.focusedWindow()
  if focusedWindow then
    moveWindowToSpace(focusedWindow, spaceNumber)
  else
    log.w("No focused window")
    hs.alert.show("No focused window")
  end
end

-- TODO: cmd and alt are reversed?
-- Bind keys cmd + shift + 0-9
for i = 0, 9 do
  hs.hotkey.bind({ "alt", "shift" }, tostring(i), function()
    log.i("Hotkey pressed: cmd + shift + " .. i)
    if i == 0 then
      moveFocusedWindowToSpace(10)
    else
      moveFocusedWindowToSpace(i)
    end
  end)
end
-- Bind keys alt + shift + 1-6
for i = 1, 6 do
  hs.hotkey.bind({ "cmd", "shift" }, tostring(i), function()
    log.i("Hotkey pressed: alt + shift + " .. i)
    moveFocusedWindowToSpace(i + 10)
  end)
end

@timvisher
Copy link
Contributor

timvisher commented Nov 9, 2024

@tlpierce:

If you have Keyboard Maestro, you can use a macro to throw windows between desktops as a workaround. This is what I'm currently doing. I unmapped the "Throw focused window to space..." in Amethyst preferences and mapped the same keystroke to the appropriate macro in Keyboard Maestro.

I found a way to do this all within a single Keyboard Maestro macro. It's not the prettiest but it's better than having to maintain 12 different macros that all do basically the same thing.

@HanSooloo
Copy link

@tlpierce:

If you have Keyboard Maestro, you can use a macro to throw windows between desktops as a workaround. This is what I'm currently doing. I unmapped the "Throw focused window to space..." in Amethyst preferences and mapped the same keystroke to the appropriate macro in Keyboard Maestro.

I found a way to do this all within a single Keyboard Maestro macro. It's not the prettiest but it's better than having to maintain 12 different macros that all do basically the same thing.

Can you share?

@timvisher
Copy link
Contributor

@tlpierce:

If you have Keyboard Maestro, you can use a macro to throw windows between desktops as a workaround. This is what I'm currently doing. I unmapped the "Throw focused window to space..." in Amethyst preferences and mapped the same keystroke to the appropriate macro in Keyboard Maestro.

I found a way to do this all within a single Keyboard Maestro macro. It's not the prettiest but it's better than having to maintain 12 different macros that all do basically the same thing.

Can you share?

(-‸ლ) I'd meant to link it. #1643 (comment) is edited.

@aeciolevy
Copy link

I don’t expect it to work at all on Sequoia. I’m not sure how to communicate it in-app, though.

I know is an open source project, but will you work on that?

Or should we look for an alternative?

@ianyh
Copy link
Owner

ianyh commented Dec 11, 2024

Working on it! #1676

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

Successfully merging a pull request may close this issue.