Skip to content

fix: Restore Fast User Switching handling on macOS 15+ - #172

Merged
artginzburg merged 1 commit into
artginzburg:mainfrom
qu4lizz:fix/fast-user-switching-multiuser
Aug 1, 2026
Merged

fix: Restore Fast User Switching handling on macOS 15+#172
artginzburg merged 1 commit into
artginzburg:mainfrom
qu4lizz:fix/fast-user-switching-multiuser

Conversation

@qu4lizz

@qu4lizz qu4lizz commented Jul 17, 2026

Copy link
Copy Markdown

Closes #127.

Hi! This brings back the Fast User Switching fix from #127 for macOS 15 and newer, where it's currently disabled.

Problem

When two users are logged in and both run MiddleClick, the middle-click gesture stops working for whichever user isn't the first one logged in. You have to log the other user out for it to start working again. I run into this every day on macOS 26.5.2 with two accounts and Fast User Switching.

#127 was already fixed once (in 5f4af9e), but that fix is gated behind a macOS version check that turns it off on 15+, on the assumption that Apple fixed the underlying issue in Sequoia. That doesn't seem to be the case, it still reproduces on 26.5.2.

Root cause

Both users' MiddleClick instances register and start callbacks on the same AppleMultitouchDevice. With two sessions holding the device at once, the private MultitouchSupport framework stops delivering frame callbacks reliably. Stopping the listeners in whichever session isn't on-console removes the contention, which is exactly what the existing session handling already does, it just wasn't running on 15+.

Changes

  • Remove the version gate so session handling runs on every macOS version. Stopping listeners while a session is in the background is harmless everywhere, so there's no downside to leaving it on.
  • Drop the 0.5s debounce that was shared between the resign and become-active handlers. Because it was shared, a become-active arriving within 0.5s of a resign could get dropped and leave the active session with its listeners off.
  • Route the become-active handler through restartListeners() (stop-then-start) instead of a bare start, so repeated or bursty session notifications are idempotent.

Testing

Tested on a trackpad, macOS 26.5.2, with two user accounts:

  • Switched back and forth between both users repeatedly, including quick switches. The gesture now works in whichever session is active, where before only the first user's session worked.
  • Confirmed from the logs that the inactive session releases the device and the active one reclaims it:
User session resigned active, stopping listeners
Successfully unregistered mouse callback.
...
Display reconfigured, but user session is inactive - skipping restart
User session became active, restarting listeners
Restarting now...
Successfully registered mouse callback.
Restart success.

I couldn't test on macOS < 15 (no machine on it). That path already had session handling enabled before this PR, so it's unchanged there apart from the debounce simplification above. Happy to attach a test build or tweak anything if a reviewer on an older version wants to verify.

@JeremyCB

Copy link
Copy Markdown

Tested on MacOS 26.4.1 successfully, thanks!

@artginzburg
artginzburg merged commit 68218b8 into artginzburg:main Aug 1, 2026
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.

Three finger with touch not working with multiple user.

3 participants