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 window to a space is broken #1676

Open
inspectorG4dget opened this issue Aug 20, 2024 · 36 comments
Open

Throwing window to a space is broken #1676

inspectorG4dget opened this issue Aug 20, 2024 · 36 comments

Comments

@inspectorG4dget
Copy link

Describe the bug
I'm able to move windows to different displays just fine.
I'm unable to throw a window to an absolute or relative desktop/space. The default key bindings are ctrl+alt+shift+<left/right> to throw the focused window to the prev/next space and ctrl+alt+shift+ to throw the focused window to the num-th space

Applications:
All applications

To Reproduce
Steps to reproduce the behavior:

  1. Launch Amethyst
  2. Launch any application and open a window
  3. Create a new space/desktop
  4. Use ctrl+alt+shift+arrows to attempt to throw the window to the next/previous space
  5. Use ctrl+alt+shift+num to attempt to throw the window to the num-th space

Expected behavior
The selected window should move to the next/previous space, or the num-th space.

Screenshots
None

Versions:

  • macOS: 14.6 (23G80)
  • Amethyst: 0.21.0 (110)

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.

Version: 0.21.0 (110)

OS version: Version 14.6 (Build 23G80)

Screens:
	(0.0, 0.0, 2560.0, 1440.0) [(0.0, 0.0, 2560.0, 1440.0)]
	(-1792.0, 169.0, 1792.0, 1120.0) [(-1792.0, 151.0, 1792.0, 1120.0)]
	(2560.0, 0.0, 1920.0, 1080.0) [(2560.0, 360.0, 1920.0, 1080.0)]

Configuration:
screen-padding-left: 0
floating: (
        {
        id = "com.jetbrains.pycharm";
        "window-titles" =         (
        );
    },
        {
        id = "com.apple.Terminal";
        "window-titles" =         (
        );
    },
        {
        id = "com.googlecode.iterm2";
        "window-titles" =         (
        );
    },
        {
        id = "com.agilebits.onepassword7";
        "window-titles" =         (
        );
    }
)
enables-layout-hud-on-space-change: 0
focus-follows-mouse: 0
window-minimum-width: 0
new-windows-to-main: 0
window-resize-step: 5
window-max-count: 0
float-small-windows: 1
restore-layouts-on-launch: 1
ignore-menu-bar: 0
enables-layout-hud: 1
layouts: (
    tall,
    wide,
    fullscreen,
    column,
    bsp
)
debug-layout-info: 1
screen-padding-right: 0
floating-is-blacklist: 1
window-margin-size: 1
use-canary-build: 0
mouse-follows-focus: 0
screen-padding-bottom: 0
window-margins: 0
follow-space-thrown-windows: 1
mod2: (
    option,
    shift,
    control
)
window-minimum-height: 0
mod1: (
    option,
    shift
)
screen-padding-top: 0

Additional context
N/A

@dklymenk
Copy link

For me this seems to have started happening after update to Sonoma (14.5).

@noamvokaal
Copy link

This happened to me after update to Sonoma 14.6.1.

@PhilipEnchin
Copy link

Having the same issue, but with a wee bit more additional detail:

  • Personal computer (issue 😭):
    • 15 inch MBP, 2018 (Intel)
    • Upgraded from macOS 13.x to 14.6.1
    • Worked before the upgrade, but not since
    • Upon hitting the keyboard shortcut to throw to another space, the window looks like it gets defocused, sent behind other windows, then refocused, all within a fraction of a second, but doesn't move to a new space
  • Work computer (no issue 🥳):
    • 14 inch MBP (Apple M3 Pro)
    • I never used any OS prior to 14.x on this machine
    • I've done one minor/patch upgrade, but not sure if I had Amethyst installed at that time
    • Works as expected (so far)

@dklymenk
Copy link

It turns out that I was on 0.21.0, which is the latest version according to the website and the in-app update checker.

0.21.1 fixes this exact issue. To update I did brew install --cask amethyst and the issue is 100% resolved for me now.

@PhilipEnchin
Copy link

Followed @dklymenk's advice and upgraded via brew, but the issue persists...

@DanCates
Copy link

DanCates commented Aug 31, 2024

For me this seems to have started happening after update to Sonoma (14.5).

It turns out that I was on 0.21.0, which is the latest version according to the website and the in-app update checker.

0.21.1 fixes this exact issue. To update I did brew install --cask amethyst and the issue is 100% resolved for me now.

@dklymenk , you said above that you are using Sonoma 14.5? The 0.21.1 update fixed the issue for M1 Macs (not Intel) on Sonoma 14.5 but it appears to have returned again in Sonoma 14.6 according to the others in this thread. As a result, I'm waiting to upgrade to Sonoma 14.6 until Amethyst is compatible. Can you confirm that you are indeed still on 14.5 and have not updated to the latest OS?

@fullofcaffeine
Copy link

+1, having the same issue :/

@pfortuny
Copy link

Same issue:

Monterey 12.7.6
MacBook Pro 15-Inch 2016
2,6GHz Quad-Core Intel Core i7

@raven38
Copy link
Contributor

raven38 commented Sep 12, 2024

@pfortuny It may be solved by #1677

@mgabs
Copy link

mgabs commented Sep 12, 2024

The issue is still present, when I tried mapping the keys to something other than arrow keys it worked.

throw-space-left:
  mod: mod3
  key: ";"

throw-space-right:
  mod: mod3
  key: "'"

However, these don't:

throw-space-left:
  mod: mod3
  key: "left"

or

throw-space-left:
  mod: mod3
  key: left

@pfortuny
Copy link

pfortuny commented Sep 12, 2024

@raven38

Unfortunately, when I try to build the bundle from the source code I get

xcbeautify: A full installation of Xcode.app 15.0 is required to compile
this software. Installing just the Command Line Tools is not sufficient.

Xcode 15.0 cannot be installed on macOS 12.
You must upgrade your version of macOS.
Error: xcbeautify: An unsatisfied requirement failed this build.
Installing xcbeautify has failed!
Homebrew Bundle failed! 1 Brewfile dependency failed to install.

Can I do anything? Thanks for the pointer, anyway!

@ckeefe-pillpack
Copy link

Also dealing with this issue.

Version: 0.21.1 (111)
OS version: Version 13.6.9 (Build 22G830)
Screens:
	(0.0, 0.0, 2560.0, 1440.0) [(0.0, 0.0, 2560.0, 1440.0)]
Configuration:
enables-layout-hud: 1
window-minimum-height: 0
screen-padding-bottom: 0
window-minimum-width: 0
debug-layout-info: 0
screen-padding-top: 0
new-windows-to-main: 0
window-max-count: 0
mouse-follows-focus: 0
screen-padding-right: 0
window-resize-step: 5
floating-is-blacklist: 1
focus-follows-mouse: 0
screen-padding-left: 0
window-margins: 0
floating: (
)
mod1: (
    option,
    shift
)
follow-space-thrown-windows: 0
restore-layouts-on-launch: 1
window-margin-size: 0
float-small-windows: 1
ignore-menu-bar: 0
mod2: (
    option,
    shift,
    control
)
use-canary-build: 0
enables-layout-hud-on-space-change: 1
layouts: (
    tall,
    fullscreen
)

@projeffboy
Copy link

projeffboy commented Sep 21, 2024

@dklymenk your approach worked at one point when I was still using the previous Mac OS version with Amethyst 0.21.1. Now that I've upgraded to Sequoia, and have upgraded to Amethyst 0.21.2, it doesn't work anymore. Throwing a window to another space makes the window disappear then quickly reappear in the same space.

@fvcci
Copy link

fvcci commented Sep 21, 2024

same issue

@Zelle97
Copy link

Zelle97 commented Sep 23, 2024

Having the same Issue on Mac OS 15.0 (Sequoia) and Amethyst 0.21.2 (112).

@raven38
Copy link
Contributor

raven38 commented Sep 23, 2024

@pfortuny
I used an older Xcode compatible with macOS 12 for build.

@miguelski
Copy link

brew to me too, i am using Mac OS 15

@gargantuanprism
Copy link

same here, just upgraded to 15.0 on an M1 MBP. my current workaround is click and hold on the title bar and press CTRL+N to move to workspace N

@DanCates
Copy link

DanCates commented Sep 28, 2024 via email

@ianyh
Copy link
Owner

ianyh commented Sep 28, 2024

You can also go into Mission Control, drag a window to the top, which will bring down a view with all of the available spaces, at which point you can drop the window into one of them. (I think. I'm typing from my phone.)

@BAAWM
Copy link

BAAWM commented Sep 29, 2024

So based on the fact you can hold the title bar and use control 1 to go to desktop one for example.
This is a Lua script for Hammerspoon. It seems to work well at least as a temp solution for switching.

local hyper = {"cmd", "ctrl", "alt", "shift"}

function clickAndHoldTitleBar()
    local win = hs.window.focusedWindow()
    if win then
        local frame = win:frame()
        local titleBarX = frame.x + 20
        local titleBarY = frame.y + 10
        local clickEvent = hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseDown, {x = titleBarX, y = titleBarY})
        clickEvent:post()
        return {x = titleBarX, y = titleBarY}
    end
    return nil
end

function releaseClick(clickPosition)
    if clickPosition then
        local releaseEvent = hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseUp, clickPosition)
        releaseEvent:post()
    end
end

function handleDesktopSwitch(key)
    local clickPosition = clickAndHoldTitleBar()
    hs.eventtap.keyStroke({"ctrl"}, key)
    releaseClick(clickPosition)
end

hs.hotkey.bind(hyper, "1", function()
    handleDesktopSwitch("1")
end)

hs.hotkey.bind(hyper, "2", function()
    handleDesktopSwitch("2")
end)

hs.hotkey.bind(hyper, "3", function()
    handleDesktopSwitch("3")
end)

hs.hotkey.bind(hyper, "4", function()
    handleDesktopSwitch("4")
end)

@Zelle97
Copy link

Zelle97 commented Sep 30, 2024

I did some slight modifications to @BAAWM script thanks for providing that! Works like a charm as a workaround.

It still has some downsides:

  • Switching only works on one monitor
  • Mouse position changes with each switch
--Bind to whatever combination you like to use
local hyper = { "alt", "shift" }

function clickAndHoldTitleBar()
	local win = hs.window.focusedWindow()
	if win then
		local frame = win:frame()
		local titleBarX = frame.x + 80
		local titleBarY = frame.y + 10
		local clickEvent =
			hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseDown, { x = titleBarX, y = titleBarY })
		clickEvent:post()
		return { x = titleBarX, y = titleBarY }
	end
	return nil
end

function releaseClick(clickPosition)
	if clickPosition then
		local releaseEvent = hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseUp, clickPosition)
		releaseEvent:post()
	end
end

function handleDesktopSwitch(key)
	local clickPosition = clickAndHoldTitleBar()
	-- You might need to change this depending on your keymapping to switch desktop
	hs.eventtap.keyStroke({ "cmd" }, key)
	releaseClick(clickPosition)
end

for i = 1, 9 do
	hs.hotkey.bind(hyper, tostring(i), function()
		handleDesktopSwitch(tostring(i))
	end)
end

@DanCates
Copy link

DanCates commented Sep 30, 2024

After further research and testing (albeit in Sonoma, not Sequoia), I found alternatives for both Space Throwing and Monitor Throwing that use the same key bindings as Amethyst's functions but avoid the need for Amethyst. While I haven't yet been able to test in Sequoia, the users on this BTT thread have tested it in Sequoia and it seems to work.

MONITOR THROWING - using native macOS shortcuts:

Full detailed screen recording here.

  1. In Amethyst preferences, delete the keyboard bindings for throwing to monitors.
  2. Open System Settings and go to Keyboard Shortcuts screen.
  3. Select App Shortcuts from sidebar and expand the All Applications section.
  4. Type the precisely spelled system name for a monitor and assign the same keyboard bindings Amethyst was using. (Find the precise system name by clicking on the Window menu in the menu bar for an open application and observing the spelling of the "Move to [XYZ Monitor Name]" selections.)
  5. Repeat this step for as many monitors as you have.
  6. Test by using the keyboard to throw a window.
  7. Mine functions exactly the same as Amethyst did and the shortcut settings look like this:
    Screenshot 2024-09-30 at 12 02 19 PM

SPACE THROWING - using BetterTouchTool:

Full detailed screen recording here.

  1. In Amethyst preferences, delete the keyboard bindings for throwing to Spaces.
  2. In BetterTouchTool, open the screen to configure Keyboard shortcuts.
  3. Hit the [+] button to add a new shortcut.
  4. Set the keyboard bindings that were used by Amethyst to throw a window to a specific space (or the throw left / right function).
  5. Now, on the action pane, click the [+] to add a new action.
  6. In the action menu, start typing in the search bar "Move window..." and it will auto-complete with options to "Move Window to Desktop 1, 2, etc." Choose the one you want.
  7. Test the new key binding by throwing an example window to the Space.
  8. You now have a replacement shortcut!
  9. Mine functions exactly the same as Amethyst did and the shortcut settings look like this:
Screenshot 2024-09-30 at 2 42 47 PM

I hope this helps!

@simonedamico
Copy link

All these workarounds follow the windows in the space, wondering if there is a way in hammerspoon to get the current space number so I can go back to it (it'll probably look absolutely rubbish though)

@kundeng
Copy link

kundeng commented Oct 3, 2024

I think it's still broken in sequoia 15.1 beta.

@ianyh
Copy link
Owner

ianyh commented Oct 3, 2024

@kundeng see #1682

@RandyBoBandy92
Copy link

After further research and testing (albeit in Sonoma, not Sequoia), I found alternatives for both Space Throwing and Monitor Throwing that use the same key bindings as Amethyst's functions but avoid the need for Amethyst. While I haven't yet been able to test in Sequoia, the users on this BTT thread have tested it in Sequoia and it seems to work.

MONITOR THROWING - using native macOS shortcuts:

Full detailed screen recording here.

  1. In Amethyst preferences, delete the keyboard bindings for throwing to monitors.
  2. Open System Settings and go to Keyboard Shortcuts screen.
  3. Select App Shortcuts from sidebar and expand the All Applications section.
  4. Type the precisely spelled system name for a monitor and assign the same keyboard bindings Amethyst was using. (Find the precise system name by clicking on the Window menu in the menu bar for an open application and observing the spelling of the "Move to [XYZ Monitor Name]" selections.)
  5. Repeat this step for as many monitors as you have.
  6. Test by using the keyboard to throw a window.
  7. Mine functions exactly the same as Amethyst did and the shortcut settings look like this:
    Screenshot 2024-09-30 at 12 02 19 PM

SPACE THROWING - using BetterTouchTool:

Full detailed screen recording here.

  1. In Amethyst preferences, delete the keyboard bindings for throwing to Spaces.
  2. In BetterTouchTool, open the screen to configure Keyboard shortcuts.
  3. Hit the [+] button to add a new shortcut.
  4. Set the keyboard bindings that were used by Amethyst to throw a window to a specific space (or the throw left / right function).
  5. Now, on the action pane, click the [+] to add a new action.
  6. In the action menu, start typing in the search bar "Move window..." and it will auto-complete with options to "Move Window to Desktop 1, 2, etc." Choose the one you want.
  7. Test the new key binding by throwing an example window to the Space.
  8. You now have a replacement shortcut!
  9. Mine functions exactly the same as Amethyst did and the shortcut settings look like this:
Screenshot 2024-09-30 at 2 42 47 PM I hope this helps!

The BetterTouchTool for space throwing has been very helpful. Thanks. Monitor throwing is still working for me as of version 0.21.2

@DanCates
Copy link

DanCates commented Oct 8, 2024

The BetterTouchTool for space throwing has been very helpful. Thanks. Monitor throwing is still working for me as of version 0.21.2

Glad to hear it! Out of curiosity @RandyBoBandy92 , what version of macOS are you using with Amethyst 0.21.2 where monitor throwing is working? I was under the impression that it was broken on Sequoia (15.0).

@RandyBoBandy92
Copy link

The BetterTouchTool for space throwing has been very helpful. Thanks. Monitor throwing is still working for me as of version 0.21.2

Glad to hear it! Out of curiosity @RandyBoBandy92 , what version of macOS are you using with Amethyst 0.21.2 where monitor throwing is working? I was under the impression that it was broken on Sequoia (15.0).

Ah.. You know maybe I should have paid better attention.. I am still on 13.6.9

@casualNavigator
Copy link

Can confirm On Sequoia 15.01 and using Amethyst 2.1.2 (112), throwing windows to workspaces doesn't work; the window that's being thrown quickly disappears and reapers on the same spot. Was previously working on Monterey before the upgrade.

@DanCates
Copy link

DanCates commented Oct 14, 2024

Thanks for the update @RandyBoBandy92 . In that case, I'm still curious that I understand correctly--maybe @casualNavigator can confirm--is it just Space Throwing or is it also Monitor Throwing that is broken in Sequoia?

@ianyh
Copy link
Owner

ianyh commented Oct 14, 2024

It's just space throwing.

@DanCates
Copy link

DanCates commented Oct 14, 2024

It's just space throwing.

@ianyh
Got it. Thanks for the clarification. Whatever method Amethyst is using to throw windows to monitors seems different than the macOS native functionality and I'm so thankful it is still working in Sequoia because my testing with the macOS native functionality (as an emergency alternative in case Amethyst monitor throwing was broken) revealed it to be a significantly worse experience. Landing windows don't easily fall into the Amethyst management on the new monitor and triggering is just unreliable. Seems like every fifth time I hit the shortcut, it just didn't work.

Thank you for EVERYTHING you've done with Amethyst. It's my first time using a window manager and I've been using it for about a year now. I'm an accountant and it has revolutionized the way I do my work on macOS. It makes me so much faster and it has basically solved all my needs to quickly open adjacent windows for comparing financial data and organizing categories of my work across multiple spaces. Glad for this opportunity to thank you personally!

@zenyarn
Copy link

zenyarn commented Oct 26, 2024

when i upgrade to macos 15, i have the same problem 😭
throw window to other space is very important to me, and i use it frequently to manage my window.

@zenyarn
Copy link

zenyarn commented Oct 26, 2024

when i upgrade to macos 15, i have the same problem 😭当我升级到macos 15时,我也遇到了同样的问题😭 throw window to other space is very important to me, and i use it frequently to manage my window.将窗口扔到其他空间对我来说非常重要,我经常使用它来管理我的窗口。

I have attempted to move the window to another space using Hammersapon and BetterTouchTool, following the solution mentioned above. However, it seems that these solutions all involve following the moved window.
But I usually just throw the window into another space and continue working in the current space. Is there any way to achieve this? (Using BetterTouchTool to combine moving the window and moving the space can indeed achieve this, but this operation is really too slow 😭)

@marvelph
Copy link

SizeUp also had the ability to move windows to adjacent left and right spaces.
However, it is not possible to move to an arbitrary space like BetterTouchTool.
https://www.irradiatedsoftware.com/sizeup/

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