Native Instant Space Switching on macOS (arhan.sh)

by PaulHoule 334 comments 644 points
Read article View on HN

334 comments

[−] aylmao 36d ago
I grew up with this animation so I didn't consider it annoying until I bought a new Macbook a couple years ago.

I noticed sometimes I would press keyboard shortcuts before my system's focus had switched. Just little stumbles here and there, some inoffensive, some annoying, but who knows maybe I didn't catch enough sleep.

Over time it happened often enough that I decided to google it, and it turns out my muscle memory wasn't failing me; the animation speed did change ever so slightly and was slower in new Macs with 120Hz displays [1][2] (newer MacBooks, 2021+). If you switch your screen to 60Hz it goes back to the faster animation.

Why is this animation slower now, and why does it depend on screen refresh rate? I have some technical theories but can't think of an organizational reason it happened and hasn't been fixed 5 years later at a 3.82 trillion market cap company. If you Google it there's plenty of discussions online about this. It's noticeable and annoying to people who have used the feature often enough.

[1]: https://discussions.apple.com/thread/256124324?sortBy=rank

[2]: https://www.youtube.com/watch?v=gNBWt4NvqHg

[−] veber-alex 36d ago
This is such an insane bug to still have around all these years.

Are apple engineers not using macOS?

[−] abustamam 35d ago
Wow I never realized I had this problem until now! I never even considered the reason keys would dispatch to the wrong window was because of the animation. I just knew that sometimes when switching workspaces I'd have to wait until whatever window I'm switching to has focus before typing.
[−] juujian 36d ago
Don't know about customizability on MacOS but I've always been very accustomed to animations and recently I just turned them off on Android and Linux and I... Don't miss anything. Turned out they don't add anything other than an initial wow factor.
[−] bschwindHN 35d ago
I noticed this immediately when I first used a 120Hz macbook in 2021. As a vanilla MacOS UI feature that I'm sure many people use, I can't believe it hasn't been fixed yet.
[−] mort96 35d ago
I also have a 120Hz Mac, and the animation is indeed slower in 120Hz mode. In my opinion, the animation crossed the line from "too slow but bearable" to "unbearable" with 120Hz. It is as you say; it's not really the animation itself that's the problem, but the delay from when I tell my machine "switch to this other workspace" until the focus switches to a window on that other workspace. The animation has this horrible ease-out effect where the last few centimeters take what feels like forever.

Getting a 120Hz Mac actually completely changed my whole macOS philosophy. I used to use spaces extremely heavily. I now almost don't use them at all, preferring window switching with cmd+tab instead.

The infuriating thing is that almost all discussion on this on the web just says "turn on reduced motion". Not only should that be unnecessary; it doesn't even fix the problem! Sure, there's no longer a sliding animation, but there's now a fade animation instead which takes just as long.

It's completely incomprehensible that Apple hasn't fixed this.

Sadly, solutions like BetterTouchTool and InstantSpaceSwitcher won't work for me because I prefer to use my trackpad to switch spaces.

EDIT: I actually recorded and compared the switching speeds a while ago: https://old.reddit.com/r/MacOS/comments/rfmg4e/workspace_swi.... Apologies for the choppy recording, QuickTime screen recording is not very good; but it gets the point across.

[−] tranceylc 36d ago
I would assume it’s something based around whatever deacceleration animation it is calculating? So in the inverse of what you would see in games that don’t support uncapped framerates. It would at least explain why the refresh rate has an inverted relationship
[−] presbyterian 35d ago
I've been having the same problem, entering keystrokes in the wrong windows when changing spaces. I'm so glad to know it's not just me, it's the fact that I just a couple months ago bought a new MBP. Thank you!
[−] jurplel 35d ago
I have noticed this bug years before Apple started selling 120hz displays. I thought for sure they would fix it after that, but to my surprise it has persisted...

I think it must go back to High Sierra or Mojave at least.

[−] theredleft 35d ago
we are a certain type of people here, aren't we?
[−] godelski 36d ago
I think Apple is making a really fatal flaw. Tbh Microsoft is doing it too.

Design good interfaces, with sane defaults but do not handcuff power users!!!

I often hear people say no one should care because there aren't many power users. They're a small portion, but that's absurd framing. They matter a lot because they're the ones that push your design language, develop new ideas, influence the general community, build new programs, find your bugs, and all of that. Apple and Microsoft are closing the ecosystems to get more control not only to exploit the users more (scrape their data) but to reduce bugs and things. But more and more people are trying these random programs because they can't figure out how to do things the right way. It's exactly why people are getting more frustrated with computers. The general public still doesn't care about data harvesting but they do care that the restrictions are handcuffing them now.

Funny enough this is also why Linux is becoming more popular. You've always had complete control but in the last 5 years the barrier to entry has plummeted. It's still not right for the average joe but it's on its way and a few more specialty distros are already there (e.g. steamos). The irony is Apple had the right idea before, even if not as modifiable as Linux, it used to be easier. But now it's more like a power trip. Consolidating control because they don't know what else to do

[−] xz18r 36d ago
I see yabai mentioned, definitely check out Aerospace. Ive tried multiple WMs after years of i3 on Linux and this is the best one I found (for me) with quite a margin. It just works (tm)

https://github.com/nikitabobko/AeroSpace

[−] tptacek 36d ago
God damnit I didn't know until 15 seconds ago that the Space-switching animation in macOS was annoying. Thanks a lot!
[−] Cider9986 36d ago
I switched to Fedora Asahi Remix[1] after being affected by this bug[2] after 5 releases of MacOS Tahoe. I am enjoying Asahi Remix with Gnome and it has sensicle window management.

[1] https://asahilinux.org/fedora/ [2] https://youtube.com/watch?v=JjptYWKGVc4

[−] Nevermark 36d ago
Tangentially related.

After a restart, and after Finder has opened multi-tab windows I have open before, clicking on a tab can suddenly move my view and the window to another space.

Apparently different tabs in the same window can think they belong to different spaces.

Something (I perceive as) common to a lot of the (perceived) increase in Apple software glitches recently, is I cannot fathom the logic for which the bug makes any sense. It does not feel like I am seeing corner case bugs, but instead major "bad-model" code, revealing its poor design.

[−] cosmic_cheese 36d ago
Clever hack. Now if there were some way to bring back the OS X 10.5/10.6 2D spaces grid… the linear design in place since 10.7 has always felt overly simplistic.
[−] Eric_WVGG 35d ago

> Pay for a license for BetterTouchTool. Enable “Move Right Space (Without Animation)” and “Move Left Space (Without Animation)”. > I managed to find [another solution] with none of the aforementioned drawbacks.

I don’t consider paying for quality software a drawback!

I’ve been using BetterTouchTool ever since the 2016 Macbook Pro with Touch Bar, so I guess that’s a decade now. It turned the Touch Bar into the best productivity enhancement I’ve ever experienced from a laptop, and evolved to suit even more use cases beyond the Touch Bar.

I consider it completely indispensable, and I doubt it would still be in (very) active development today if fans like me weren’t paying for it.

[−] phren0logy 36d ago
Having been ruined by Linux options like Hyperland and Niri, I’m digging my early foray into OmniWM - https://github.com/BarutSRB/OmniWM
[−] flawn 36d ago
Hey! I built InstantSpaces (which you had linked in the footnotes) and am well aware of issues with the injection & patching. It works 90% of the time for me and was good enough for me to share. But there are cases where it bugs. And yes, Tahoe is a to-do.

I will hopefully soon have the time to try to make it more robust. Feel free to take a shot at it if you want!

[−] buster 35d ago
I recently had to switch to macos for work and Jesus Christ is this not the pinnacle of engineering. Sure, I'm accustomed to my self configured Linux desktop but boy is Mac OS slow to use and hard to configure. And so keyboard unfriendly.
[−] aequitas 36d ago
Wonderful, that leaves 2 things on the top of my list for spaces: having to hover your mouse over the top left corner of a space and waiting until it shows the closing icon. And Safari deciding its better to switch to a space and open a window that was minimised there instead of just opening a new window in the space i'm currently in (even with the "switch to a space" setting turned off!) when 1 want to open a new tab.
[−] tern 35d ago
I did an exhaustive comparison of window managers and settled on using Raycast for simple resizing (full screen, center, mid-size centered, 1/2, 1/3, 2/3 left/right) + FlashSpace[1], which implements simple virtual spaces with instant switching.

You can also use Rectangle or Spectacle or others in place of Raycast.

Foolproof with zero magic.

[1] https://github.com/wojciech-kulik/FlashSpace

[−] bfirsh 36d ago
Here's a script to install and configure, in case it's helpful for anyone's dotfiles: https://github.com/bfirsh/dotfiles/blob/48eff70daa754216eff9...
[−] modeless 36d ago
This is nice. Sounds like it wouldn't solve the slow animation when entering or leaving full screen mode though. I'm fed up enough with macOS's poor window management (among many other things) that I'm looking for MacBook alternatives.

The M5 chip is way ahead of Intel's latest, even Panther Lake. But the Snapdragon X2 Elite looks like a viable alternative. It's the only competitor with comparable single core performance, and it comes with 48 GB of extremely fast RAM for a reasonable price with great battery life. Unfortunately Linux support isn't really there yet, but hey M5 MacBooks don't support Linux well either.

[−] nicoburns 36d ago
I'm still incredibly frustrated by Apple's Mission Control and Full Screen features. The old Expose and Spaces and windows-style maximise would be so much better.
[−] tnightengale 36d ago
Stop using MacOS spaces. Never full screen anything. Throw everything around with hotkeys using OSS rectangle. Use shortcat to automatically bring your cursor to anything on your screen and use enter to click and type.
[−] modernerd 35d ago

> Pay for a license for BetterTouchTool. Enable “Move Right Space (Without Animation)” and “Move Left Space (Without Animation)”.

I did not know BTT supported this until today!

You can just set up the trackpad 4-finger swipe actions globally: https://cleanshot.com/share/P0K1PGC1

Then in System Settings set "swipe between full-screen applications" to "off" in Trackpad settings under "more gestures" so that BTT's shortcut applies instead of the system-level one.

Works well. No extra software needed if you already have BTT, which is worth the money for me purely for "alt+drag a window from anywhere" style window movement. That setting is buried deep under BetterTouchTool Settings → Window Snapping & Moving → Moving & Resizing Modifier Keys: https://cleanshot.com/share/mnF9xBkW

[−] benji-york 36d ago
By way of experience report: I've been using this app for a week or so on my daily driver and it's been great.
[−] jjcosgrove 35d ago
[video]

just sharing for sh*ts n' giggles... inspired by this post and a previous annoyance i had around spaces in general... i just 'vibe coded' (don't start) this using codex this morning (built upon InstantSpaceSwitcher's UI)

https://www.jjcosgrove.com/assets/videos/spaced.mp4

basically:

- you can set custom names per space

- you can hotkey-navigate to each space/any space

- it has a visual indicator in menubar (active/vs inactive in case you use mission control)

- you can show a nice grid overlay (to click or arrow-nav to a space)

- it has unified shortcut/name management via UI (rather than needing a seperate util)

names are retained on restarts, spaces are synced if mission control creates any (as best as you can with mac's private apis).

for personal utilities like this, it works quite well and sometimes its good to just have 'fun'

oh and the 'jank' relates to how spaces works (i think), but can be removed/avoided by enabling 'reduce motion' which i think the original post mentions.

[−] adamnemecek 36d ago
What do people use for Windows-like window management on macos? I tried a bunch of them and I'm not a fan of any of them.

I actively dislike the notion of spaces.

[−] primaprashant 36d ago
I love using (tiling) window managers, and one of the most important requirements for me is having a key binding for switching to the last active workspace. The proposed solution in the blog doesn't achieve this. I use Aerospace on macOS right now and think it's the best solution available.

I generally have fixed workspaces for different things: first for a browser, second for a code editor, third for a terminal, and so on. If I want to switch between the browser and code editor, I can do that with a single key binding, usually Alt+Tab. The same binding lets me switch between the code editor and terminal just as easily.

When you have something like 10 different workspaces, not having this key binding becomes annoying. If you need to alternate between windows on workspace one and workspace eight, you're stuck using both hands to press Control+1 and then Control+8. But with a last-active-workspace key binding, you can just Alt+Tab between them. This is the killer feature I always need.

[−] ivanjermakov 36d ago
Amazing how much effort is needed from a billion dollar company to make a feature present in my 1kLOC window manager.
[−] aesopturtle 35d ago
This is one of those classic examples of software feeling ‘heavy’ for reasons that have nothing to do with hardware limits. People often talk about performance in terms of benchmarks, but interface latency on routine actions probably matters more to happiness than a lot of headline metrics. Nice work.
[−] mintplant 36d ago
Awesome! Is there a working way to do the same for Windows virtual desktops? I remember I used to do it with ViVeTool [0], but Microsoft removed the feature flag at some point.

[0] https://github.com/thebookisclosed/ViVe

[−] Fraterkes 36d ago
I'm new to MacOS, is the thing they're refering to when you swipe left/right with three fingers to switch between different fullscreen apps / desktops? I kinda like the animation, after decades of windows I'm still impressed when switching between programs isn't stuttery.
[−] gib444 36d ago
I installed Debian stable + i3 + x11 on a desktop today - what a breath of fresh air (not that I'm new to Linux) compared to MacOS. No bloat. No animations. No lag. A perfect tiling WM.

No Secure Boot, no TPM, no SIP, no phoning home to the mothership to check if I'm allowed to launch an app, no spyware, no telemetry, no update nags, no trying to trick me into upgrading to the next major version.

I tried Sway & Wayland but IntelliJ freaked out so I went to x11

Also Nouveau seems pretty damn good these days.

KeepassXC works much better on Linux which is nice.

I'm keeping my M4 Macbook Air around for a while to play with local LLMs but it's not exactly the best for that, so I'll think it'll be on eBay not before long, because MacOS is getting more and more annoying...

[−] littlecranky67 35d ago
The animation has bugged me for years! Thanks to the blog post, I found out that BetterTouchTool - which I am already using - has this feature since a couple of versions and now I could enable it. Wasn't aware of that, sometimes the solution is so easy.
[−] skupig 35d ago
You can use yabai without any of the tiling functionality (set the default mode to "float"), I have actually been using it with BTT to fix this exact problem. Thanks for letting me know that a fix has been added directly to BTT though!
[−] ray__ 36d ago
This looks interesting and I will give it a try. I agree that the space-switching animation is painful.

I don't however think that this will solve spaces on MacOS, for the simple reason that opening new instances of apps is inconsistent and often doesn't behave how you'd expect it to once one more than one space is involved (in my experience, anecdotal).

I've come to peace with the fact that I will never be able to simultaneously experience the productivity of i3 and the necessary evil of MS Office/Illustrator on the same OS. The most important factor in my work is who I work with (rather than what I work with) so I'll remain on the latter train for now.

[−] mabedan 35d ago
Is there a tool which eliminates the animation, also when switching between apps with cmd+tab? I almost never use ctrl+→, I just know what application I want to switch to.

All these apps that I tried only fix the ctrl+→, but not application switching

[−] hirvi74 36d ago
I eventually became so frustrated with spaces in OSX, that I essentially try to avoid using them in macOS these days. Seriously, all I want is a way to move windows from one space to another via keybindings. I am not asking for much. In fact, IIRC, I think Snow Leopard had this feature. I know there were various solutions that cropped up, and even currently there are a few hacks. It just... such bullshit that it's not built in.

If one has a disability that hinders his or her ability to use a mouse/trackpad, then I strongly suspect there is no way for such a person to use spaces on macOS well. Though, it seems Apple could not care less.

[−] tnightengale 36d ago
The giga brain move is to stop using MacOS spaces. Never full screen anything. Use an OSS window management tool like rectangle (similar to deprecated spectacles).

Use shortcat to bring your cursor to any element with just typing.

[−] j0r0b0 36d ago
There's a lot of great options in the field of macOS window managers. Instant switching to another space is one of the big features I was looking for too.

Exploring wm for macOS, I realized there was a lot of good software, so I built a directory website to try and list them all: https://macoswm.com.

yabai and AeroSpace are two personal favorites. OmniWM [1] is the current favorite on macosWM.com

[1] https://github.com/BarutSRB/OmniWM

[−] IOT_Apprentice 36d ago
BetterTouchTool is $25 for a lifetime license with upgrades.
[−] DDayMace 36d ago
I much prefer gnome for multiple desktop switching and app switching in general. Seeing this article I know there are many on macos who agree!
[−] gechr 36d ago
Nice. I wrote a little menubar app and Space switching has been a thorn in my side, including going down the "Yabai integration" route. Will have to take a look at this and see if I can borrow some ideas!

Shameless plug: https://github.com/gechr/WhichSpace

[−] rendx 36d ago
I didn't check if it makes any difference, but I see hardly any animation with “Reduce motion” enabled.

The article mentions this has the unfortunate side effect of also setting prefers-reduced-motion in browsers, but that can be mitigated by changing the browser settings (Firefox: about:config: ui.prefersReducedMotion. 0 (enable) or 1 (disable)).

[−] keerthiko 35d ago
I'm not a big space-switcher on OSX, mostly because each of my applications come with spaces (browser, IDE, etc), but unskippable UI animations are an instant roadblock.

Looks like HN hug of death killed your comments section though:

> An error occurred: API rate limit already exceeded for installation ID 65180581.

[−] albertjs 35d ago
I've been using option 1 (reduced motion) since I got my first MacBook years ago. Trying to fix the browser issue you mentioned is how I discovered Chrome flags. I now open chrome with the --force-prefers-no-reduced-motion flag.

This looks great though, will give it a go!

[−] joeevans1000 35d ago
I struggled with the same annoyances for years. Then I installed TotalSpaces... but I think that stopped working. Liquid Ass destroyed my iphone and apple watch and I was able, thank god, to stop it from infecting my MacBook. At the cost of the newest updates.

Apple. You suck.

[−] hmokiguess 36d ago
Can you use this with the trackpad gesture though? That's the only thing that has me locked in, the muscle memory of trackpad is hard to beat for me and unfortunately I rather suffer through the animation then move to the keyboard
[−] zlies 36d ago
Honestly, this animation in one of the best things about spaces in macOS. I use the four finger gesture to switch spaces all the time and it make the spaces feature so much more natural than all other window managers I’ve used before
[−] isodev 35d ago

> Apple has continuously ignored requests

Apple being completely oblivious to what normal people actually need or want is like bad weather- can’t do anything about it (Apple is so big and unregulated), just try not to forget to take an umbrella.

[−] msephton 35d ago
Synthesizing a really fast swipe to remove the transition is absolutely genius.
[−] al_borland 36d ago
I don't use Spaces at all, probably in part because of the speed. I can't bring myself to run an application all the time to solve this, when it should just be a variable somewhere that needs to change.
[−] itubaj 36d ago
The thing that most bothers me is that there seems to not exist a good solution for spaces that allows a grid set of spaces, like the one you can configure on Linux Gnome DE. That thing was so useful...
[−] __mharrison__ 35d ago
Kudos for the crazy hack (fast swipe). I'm in the aerospace crowd...