Native Instant Space Switching on macOS

(arhan.sh)

119 points | by PaulHoule 1 hour ago

29 comments

  • aylmao 11 minutes 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 I would at times 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

  • Cider9986 16 minutes 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

  • tptacek 31 minutes ago
    God damnit I didn't know until 15 seconds ago that the Space-switching animation in macOS was annoying. Thanks a lot!
    • el_benhameen 13 minutes ago
      Just wait until you notice that it’s inexplicably slower on 120hz monitors and that your input devices remain focused on the previous space until the animation fully completes!
  • Nevermark 10 minutes 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.

  • modeless 7 minutes 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, 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.

  • xz18r 20 minutes 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

  • phren0logy 1 hour ago
    Having been ruined by Linux options like Hyperland and Niri, I’m digging my early foray into OmniWM - https://github.com/BarutSRB/OmniWM
    • yuters 1 hour ago
      It is very good even though it's in early development. Issues are getting fixed almost as fast as I can find them. I have to use macOS sometimes for work and OmniWM made it bearable.
    • sgloutnikov 1 hour ago
      Same boat and whoa this looks nice! Will give it a try thank you!
  • nicoburns 38 minutes 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.
    • Analemma_ 5 minutes ago
      I agree that I miss when spaces could be on a grid in Snow Leopard instead of only in a straight line, but what is wrong with Exposé? From my POV it works the same as it always has.
  • benji-york 40 minutes 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.
  • cosmic_cheese 1 hour 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.
    • wolvoleo 17 minutes ago
      That is indeed the biggest thing I missed so much. When I finally moved from macOS to KDE I got the grid desktops back and I love them so much.

      I have 9 virtual desktops and a 3x3 grid is so much easier to navigate than a row of 9. Also, Apple makes them dynamic now. I have each desktop assigned to a specific purpose. It's like having 9 computers at my fingertips.

      Almost every release of macOS after 10.6 or so dropped something I used and the replacement if any was rarely good enough. So it started rubbing me the wrong way, more and more with every release. I'm so glad I'm no longer on an opinionated OS but that I have a desktop environment that cherishes configurability and options.

      In keeping with this, for the transition animation you can choose several options like a fade and a slide, you can turn them off completely (as this hack does for macOS). You can even set the speed of some transitions. I have it set to slide but faster than normal. So the sliding gives me a little spatial awareness of where I move within the grid, but it still feels snappy. All just by ticking some options. I love KDE <3

  • aequitas 46 minutes 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.
    • vict7 34 minutes ago
      I have been dealing with the same issue and thought I was going crazy that the setting which purports to fix this exact behavior simply doesn’t work?
      • aequitas 26 minutes ago
        At least the setting does work in reducing the switching when you cmd-tab to an application with no open windows in the current space. But I think some of this annoying switching behaviour is application specific logic and they just didn't get it right with Safari, some other applications do get it right though.
    • draw_down 30 minutes ago
      [dead]
  • Aaronstotle 16 minutes ago
    I think it was iOS 9 that had some glitch where the animations were completely disabled and it was a really awesome experience to click an app and have it instantly open with zero animations.
  • gechr 28 minutes 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 28 minutes 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)).

  • Fraterkes 1 hour 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.
    • rahimnathwani 1 hour ago
      Yes, and the app they're recommending emulates that swipe, but really really fast, so it looks instant. And you don't have to swipe 8 times to go from #1 to #9.
    • rwc 1 hour ago
      Now do it 100x every day and see if it gets old :)
    • satvikpendem 1 hour ago
      It get annoying after a while, especially if you're swiping a lot, such as having an IDE and test app / Simulator in one space and a browser in another.
      • hhh 1 hour ago
        it just blends into the background for me personally, i found it annoying a little when i swapped from multiple monitors to one
  • ray__ 1 hour 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.

    • satvikpendem 1 hour ago
      Why not use a macOS i3-like window manager like yabai or komorebi (paid)?
      • lynndotpy 1 hour ago
        This is addressed in the post.

        > There are only two problems: for one, yabai does this by binary patching a part of the operating system. This is only possible by disabling System Integrity Protection at your own discretion. For the second, installing yabai forces you to learn and use it as your tiling window manager1. I personally use PaperWM.spoon as my window manager. Both of which are incompatible when installed together.

        • satvikpendem 1 hour ago
          I was referring to their last line ("I will never be able to simultaneously experience the productivity of i3 and the necessary evil of MS Office/Illustrator on the same OS") not the linked article because the parent doesn't "think that this will solve spaces on MacOS" therefore I gave a suggestion that would.

          Secondly I don't find anything that bad about why the article's author doesn't want to use yabai, I generally disable SIP anyway (because I want to install anything I want without restriction, even edit system files because that's necessary in some cases, as yabai does); and they just don't want to learn a new WM which is fine for them but isn't a valid reason for everyone to not use yabai.

        • niij 1 hour ago
          You can turn tiling off

          `yabai -m rule --add app=".*" manage=off`

    • FireBeyond 48 minutes ago
      > 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

      System Settings > Desktop & Dock "Automatically rearrange Spaces based on most recent use". This is the critical part.

      And then right click App on the Dock, Assign to this Dock.

      With these two things, Spaces becomes predictable and repeatable.

  • ralphc 25 minutes ago
    Works on my Intel mac running Sonoma 14.8.2. I use Omakub on my Linux machine and missed this when on my mac.
  • airstrike 29 minutes ago
    I wonder how this compares to Aerospace, which I use daily but ultimately has felt a bit janky and slow
  • rwc 1 hour ago
    Just installed and I have to say, works exactly as promised. This is a huge quality of life upgrade, thank you for sharing it Paul.
  • IOT_Apprentice 13 minutes ago
    A lifetime license for BetterTouchTool with ALL its features is $25. The time the author spent on this is well over that amount.
  • walthamstow 1 hour ago
    I never run more than one space and instead switch between windows with the app Alt Tab
    • satvikpendem 1 hour ago
      I do both, Alt-Tab works well for spaces as well since it can discriminate which window is in which space.
  • veber-alex 14 minutes ago
    Wow, works great.

    I used to use yabai for this but I can't disable SIP anymore on a work laptop.

    Also, stuff like this is why I really hate macOS sometimes.

  • jiehong 21 minutes ago
    Outstanding!
  • throwatdem12311 43 minutes ago
    Can’t say that the sliding animation has ever been the bottleneck to my productivity.
    • jgauth 25 minutes ago
      I've seen this sentiment often. For example, in a discussion about slow nvm load times: "Does adding 0.5s delay to opening your terminal really affect your productivity?"

      I agree that these small things are not bottlenecks to my productivity. I can work just fine despite them. However there is some intangible effect they have on my mindset when I'm working. The more "snappy" my computer feels, the easier it is to enter a sort of flow state. Small bits of friction here and there add up.

  • tomi_dev 46 minutes ago
    Curious — what was the hardest part to get right here? Was it performance or handling edge cases?
  • adamnemecek 1 hour 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.

    • Tempest1981 12 minutes ago
      My Cmd-TAB frustration is I'm usually moving the mouse while I press it, causing the mouse to select some unwanted app. It doesn't help that the row of apps forms a solid bar across the center of my display.

      Wish I could ignore mouse movement when the app switcher is displayed.

    • satvikpendem 1 hour ago
      Rectangle with Alt-Tab (both open source), the latter is especially useful as I hate macOS' application- rather than window-level switching, Alt-Tab returns it to Windows-like behavior.
    • airstrike 26 minutes ago
      Aerospace with opt+key to go to that space, cmd+opt+key to send a window to that space, then just make a mental map of where everything is. I use mnemonics like always putting discord on workspace "D" so it becomes quite fast
    • probabletrain 1 hour ago
      I use https://rectangleapp.com/ and enjoy it. I have shortcuts to move windows to the left/right half of the screen, and cycle between monitors. This, combined with native cmd+tab and cmd+` is enough for me.
    • ubercore 1 hour ago
      This doesn't answer your question, but Aerospace (tiling WM) has been good for me to not use spaces. I don't mind spaces in theory, but the slow animation, for whatever reason, just really irks me.
    • fellowniusmonk 1 hour ago
      I use the r+cmd app for deterministic app switching.

      Caps mapped to right command.

      Karabiner to map dual-cmd+jkl; to mapped vertical slice so j is left quarter, j+k is left side, etc.

      dual-cmd+i moves windows between screens and dual-cmd+u rotates current window through full, top half, bottom half.

      The whole thing is deterministic and super fast and gives me more permutations than I'll ever need.

    • guessmyname 1 hour ago
      Every [*] macOS user uses Rectangle.app — https://rectangleapp.com

      The ones who don't use it is because they don’t know it exists.

      Or they are still using the (deprecated) Spectacle.app — https://github.com/eczarny/spectacle

      [*] if you wonder why I say “every user” even though it’s obviously not true is because everyone loves hyperbole in this website.

      • cloudfudge 1 hour ago
        I can prove everyone doesn't love hyberbole because I have found a counterexample, but I cannot prove everyone doesn't use Rectangle.app.
  • user3939382 9 minutes ago
    I’ve used TotalSpaces for this in the past, though Apple has essentially ruined the ability to make these tools successful with their SIP bullshit
  • j0r0b0 7 minutes ago
    [dead]
  • hk1337 50 minutes ago
    meh, i like the animation. I normally use it with the trackpad so the swiping back and forth makes it feel more natural if there's animation.