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

Revive window grab space shifting #1698

Merged
merged 18 commits into from
Dec 14, 2024
Merged

Revive window grab space shifting #1698

merged 18 commits into from
Dec 14, 2024

Conversation

ianyh
Copy link
Owner

@ianyh ianyh commented Nov 28, 2024

No description provided.

@ianyh
Copy link
Owner Author

ianyh commented Nov 28, 2024

If anyone wants to try it.

Amethyst.zip

@kjendrzyca
Copy link

Just tried it on Seqoia 15.0.1 (24A348) and it moves the cursor, but the window isn't moved.

@ianyh
Copy link
Owner Author

ianyh commented Nov 28, 2024

You need to set the system shortcuts for traversing spaces. This piggybacks on top of them.

@kjendrzyca
Copy link

You need to set the system shortcuts for traversing spaces. This piggybacks on top of them.

I have those enabled and use them all the time:

image

@ianyh
Copy link
Owner Author

ianyh commented Nov 28, 2024

Ah, the code assumes they use ctrl and not option for the modifier there. It was not particularly robust, which is why I went the private api route.

@ianyh
Copy link
Owner Author

ianyh commented Nov 30, 2024

@kjendrzyca this build should detect it automatically. Amethyst.zip

@ianyh
Copy link
Owner Author

ianyh commented Nov 30, 2024

And another build that shouldn't need the user to manually enable them.
Amethyst.zip

@ianyh
Copy link
Owner Author

ianyh commented Dec 2, 2024

Now I just need to test this with multiple screens.

@ianyh
Copy link
Owner Author

ianyh commented Dec 2, 2024

Amethyst.zip

@pfortuny
Copy link

pfortuny commented Dec 2, 2024

Works quite well between spaces 1-4 (does not work to move windows
from workspace 5 to any other workspace, but this is secondary to me).

You did it!

Thanks a lot.

macOS Monterey 12.7.6
MBPro 15-inch 2016, 2.6GHz Quad-Core Intel Core i7

Edit:
Please notice that the 5 workspace thing might be a personal issue (this is a very old laptop and I may have misconfigured something over the years).

@JordyScript
Copy link

Amethyst.zip

This build (21.2 (116)) still doesn't work for me. It works partly on the internal display but not on external displays. Sometimes throwing to a different space will throw the window to a different display (not consistently though) but most often the window will just flicker and remain on the same space on the same display.

To be more specific.

  • Throwing to a the left or right doesn't work on external displays.
  • Throwing to the left doesn't work on the internal display.
  • Throwing to a specific space (e.g. space 3 or space 6) seems to work relatively well.
  • Throwing to different displays works flawlessly

Can I do anything for you to help diagnose?

I'm on macOS Sequoia 15.1.1 (24B91), M2 max chip.

@ianyh
Copy link
Owner Author

ianyh commented Dec 5, 2024

Yeah, it's broken on multiple displays because of the order of operations. I have a fix for that, but it still needs a bit of testing.

@kjendrzyca
Copy link

Amethyst.zip

Works great on 15.0.1 (24A348) now, thank you! The only issue I'm seeing is that smaller floating windows like Amethyst preferences flicker when throwing. But that's not an issue at all.

@marvelph
Copy link

marvelph commented Dec 7, 2024

Amethyst.zip

If a full-screen window is placed anywhere other than at the end of the space list, the transition destination when the window is thrown to the left or right seems to be incorrect.
For example, the following situation.

1 [2] F 3 4 5 6 7 8 9

If you move twice to the right here, it moves to 5 for some reason.

1 2 F 3 4 [5] 6 7 8 9

If I try to move one more time to the left, it does not move.

1 2 F 3 4 [5] 6 7 8 9

My environment is single display.

@ianyh
Copy link
Owner Author

ianyh commented Dec 9, 2024

I think I got multiple displays working correctly, and I fixed the issue with throwing left and right in the presence of full screen windows.

@ianyh
Copy link
Owner Author

ianyh commented Dec 9, 2024

Amethyst.zip

@marvelph
Copy link

marvelph commented Dec 9, 2024

Amethyst.zip

Full-screen windows can now be successfully moved left or right, even if the full-screen window is in the middle of a space list.

@SeaButts
Copy link

SeaButts commented Dec 9, 2024

Amethyst.zip

Tried this out. It fixed the issue with my web browser windows (Firefox) and terminal windows.
I did not test any other apps.

For some reason, Visual Studio code (1.95.3) had some issue where after throwing a window to a new space, Amethyst was not recognizing the window as part of that space and not updating the layout. Even if I changed the layout (from fullscreen to tall for example), the window that was thrown is not recognized as part of that space and can't be focused with keyboard shortcuts.

This would resolve if after throwing the window, I switched spaces and then back to the space again.


As another note, I tried disabling "Follow thrown windows between spaces" and noticed a strange behavior where my focus DID follow the window, but then would automatically switch back to my previous work space.

I'm wondering if there is a conflict with my keyboard shortcuts between amethyst and mission control.

@SeaButts
Copy link

SeaButts commented Dec 9, 2024

Amethyst.zip

Tried this out. It fixed the issue with my web browser windows (Firefox) and terminal windows. I did not test any other apps.

For some reason, Visual Studio code (1.95.3) had some issue where after throwing a window to a new space, Amethyst was not recognizing the window as part of that space and not updating the layout. Even if I changed the layout (from fullscreen to tall for example), the window that was thrown is not recognized as part of that space and can't be focused with keyboard shortcuts.

This would resolve if after throwing the window, I switched spaces and then back to the space again.

As another note, I tried disabling "Follow thrown windows between spaces" and noticed a strange behavior where my focus DID follow the window, but then would automatically switch back to my previous work space.

I'm wondering if there is a conflict with my keyboard shortcuts between amethyst and mission control.

Despite not being in fullscreen mode. Unchecking this option in VS Code resolved my issue!

Window: Native Full Screen

image


I am seeing similar issues about windows not being recognized. I don't have those apps to test, but VS Code allowing me to toggle that setting and resolving the issue seems promising.

If there was a way to switch full screen mode at the system level to use "zoom" mode instead, I wonder if there would be less apps with issues.

image

image

All though, worth noting that on my machine Firefox uses "Full screen mode" and works with throwing between spaces


Test Cases:
Works

  • All native mac apps seem to work (Finder, terminal, music, preview)
  • Firefox (133.0)
  • Microsoft Outlook

Doesn't Work

  • Chrome
  • Edge
  • 1Password
  • Microsoft Teams

Notably Works

  • VS Code
    • Works with Window: Native Full Screen unchecked
  • Adobe Creative Cloud
    • The launcher works, the apps do not

Notably doesn't work

  • Adobe Suite (Tested Photoshop, Premiere, Illustrator, InDesign)
    • despite not having fullscreen mode... Photoshop, Illustrator, InDesign, Premiere all seem to have major issues beyond the scope of throwing between spaces (I can not get their layout to be managed with Amethyst)

@ianyh
Copy link
Owner Author

ianyh commented Dec 10, 2024

@SeaButts thank you for the thorough report!

@SeaButts
Copy link

@SeaButts thank you for the thorough report!

Thanks for your work on this and tackling the new OSX changes.

Since the main apps I manage work with this build, the bulk of my workflow is actually resolved with this version!

Here are my settings in case anything else sticks out.

Version: 0.21.2 (117)

OS version: Version 14.6.1 (Build 23G93)

Screens:
	(0.0, 0.0, 1792.0, 1120.0) [(0.0, 0.0, 1792.0, 1120.0)]
	(-414.0, 1120.0, 2560.0, 1440.0) [(-414.0, -1440.0, 2560.0, 1440.0)]

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

@ianyh
Copy link
Owner Author

ianyh commented Dec 12, 2024

Made some changes that I think address the issues with some applications—I tested with Chrome and VS Code. I think it's the difference between a native title bar and a custom one. That was the difference with that option in VS Code.

Amethyst.zip

@SeaButts
Copy link

Made some changes that I think address the issues with some applications—I tested with Chrome and VS Code. I think it's the difference between a native title bar and a custom one. That was the difference with that option in VS Code.

Amethyst.zip

All previous non-working apps are working!
Checking or Unchecking "Native fullscreen" in VS Code also worked.

The Adobe apps mentioned above do not work -- they are completely ignored by Amethyst -- but honestly, not usually working with them anyway. Sharing for awareness.

image

@ianyh ianyh marked this pull request as ready for review December 14, 2024 01:05
@ianyh ianyh merged commit dc6bf0f into development Dec 14, 2024
1 check passed
@ianyh ianyh deleted the space-moving branch December 14, 2024 01:06
ianyh added a commit that referenced this pull request Dec 14, 2024
* development:
  Revive window grab space shifting (#1698)
  Amethyst 0.21.2 (#1652)
  Update README.md with workspaces-auto-swoosh suggestion (#1664)
  Apply yabai's fix for moving windows between spaces in macOS 12, 13, and 15 (#1677)
  Apply yabai's fix for moving windows between spaces in macOS 14.5 (#1648)
  Add new option to sample config (#1642)
  Amethyst 0.21.0 (#1606)
  Support a fifth screen (#1627)
  Remove RubyGems (#1611)
  Replace `xcpretty` with `xcbeautify` (#1609)
  Correct typos on sample config file (#1610)
  Further attempts to fix space moving focus loss (#1591)
  Remove the old icon file (#1594)
  Sort json keys for custom layout ids (#1592)
  Clarify window margin behavior (#1589)
  Update the correct name for a layout in config sample (#1587)
  Only perform raise ax action when focusing (#1586)
  Add preference to hide menu bar icon (#1583)
  Improved Clarity for Accessibility API Permission Instructions (#1575)
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

Successfully merging this pull request may close these issues.

6 participants