ianyh / Amethyst

Automatic tiling window manager for macOS à la xmonad.
https://ianyh.com/amethyst/
MIT License
14.81k stars 487 forks source link

Throwing window to a space is broken #1676

Open inspectorG4dget opened 2 months ago

inspectorG4dget commented 2 months ago

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:

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 commented 2 months ago

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

noamvokaal commented 2 months ago

This happened to me after update to Sonoma 14.6.1.

PhilipEnchin commented 2 months ago

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

dklymenk commented 2 months ago

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 commented 2 months ago

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

DanCates commented 2 months ago

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 commented 2 months ago

+1, having the same issue :/

pfortuny commented 2 months ago

Same issue:

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

raven38 commented 1 month ago

@pfortuny It may be solved by #1677

mgabs commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

same issue

Zelle97 commented 1 month ago

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

raven38 commented 1 month ago

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

miguelski commented 1 month ago

brew to me too, i am using Mac OS 15

gargantuanprism commented 1 month ago

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 commented 1 month ago

This is amazing! I didn't know you could hold a title bar and move to other workspaces natively in MacOS! Thanks for this tip! I've been waiting to upgrade to 15.0 so that I don't break Amethyst yet but without a foreseeable solution coming, I'm trying to figure out what options I have if I move forward anyway. Space throwing is extremely important to me and I use it non-stop so having some kind of solution is critical.

Sent via Superhuman ( @.*** )

On Sat, Sep 28, 2024 at 11:47 AM, gargantuanprism < @.*** > wrote:

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

— Reply to this email directly, view it on GitHub ( https://github.com/ianyh/Amethyst/issues/1676#issuecomment-2380714609 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/ADGZONGMBLZXJ24334E4X4DZY3FQJAVCNFSM6AAAAABM2RTJLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBQG4YTINRQHE ). You are receiving this because you commented. Message ID: <ianyh/Amethyst/issues/1676/2380714609 @ github. com>

ianyh commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

It still has some downsides:

--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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

ianyh commented 1 month ago

@kundeng see https://github.com/ianyh/Amethyst/discussions/1682

RandyBoBandy92 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

It's just space throwing.

DanCates commented 3 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago

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/