← 返回日报
预计 3 分钟

"Fix" MacBook Neo Cursor Lag: Record 1 Pixel of the Screen Every 10 Seconds

摘要

文章描述 macOS Tahoe 26.5.1 上 MacBook Neo 出现的鼠标光标卡顿问题,主要发生在屏幕边缘或进入 Terminal 窗口时。作者观察到卡顿时系统可能在硬件光标与软件光标之间切换(提到 CGCursorIsDrawnInFramebuffer 状态变化),但具体原因不确定,可能与图形渲染或窗口环境有关。 在解决方案上,作者认为直接修复需要 Apple 层面处理,或强制系统始终使用软件光标(涉及逆向 WindowServer 及系统权限限制)。作为临时方案,还提到开启 macOS 色彩滤镜、调整光标大小等方法,但可能影响显示效果或在 Night Shift 下效果有限。 最主要的 “偏门修复” 是开启屏幕录制,通过让系统持续进行捕获来触发软件渲染路径,从而消除卡顿。该方法 CPU/GPU 开销很低(例如每 10 秒记录 1 像素并丢弃到 /dev/null),并可打包成一个无需 Xcode 的 .app。副作用是会出现屏幕录制指示图标,但作者认为可以接受或在全屏场景下暂停。此外也提到另一种思路是复现 Terminal 的特殊渲染行为并用覆盖窗口触发相同机制。

荐读理由

无任何寻求结果可被兑现:内容仅为 MacBook Neo 特定硬件光标滞后(边缘/终端触发)的 hack 方案(每 10 秒录 1 像素至 /dev/null),与 AI 工程/创业的迁移方法、洞见、真实变化或一手信号无关,也不改变判断

原文

Unlag Neo: A "fix" for the cursor lag on Macbook Neo

Macbook Neo (I'm on macOS Tahoe 26.5.1) cursor is lagging when the cursor is near the screen's edges or when it enters a Terminal window. [1][2][3][4][5]

[Click here for more info and background]

Why is it lagging?

I don't know. But at the moment when it lags the system switches from hardware cursor to software cursor (CGCursorIsDrawnInFramebuffer() goes from 0 to 1) so maybe that transition is stalled somehow on Macbook Neo. Maybe on the screen's edges half of the mouse is rendered and in the Terminal there is some other graphics stuff happening, so that's why macOS wants to use SW cursor there, but idk. For some reason, HW cursor is only used after ~17 seconds after the screen was locked. Before that, there is no lag.

Proper fix:

Either fix the lag directly (hope Apple does it) or maybe forcing to always use SW cursor would help as a intermediate step. To force SW cursor directly we could reverse engineer WindowServer but that probably implies turning SIP off and stuff. Or maybe not. And maybe HW/SW cursor is just a correlation. We could also look what happens ~17 seconds after Mac is unlocked.

Other ok "fix" for now:

You can also turn on macOS Color Filter (e.g. Blue/Yellow filter) to low setting, but this changes the colors a bit and doesn't seem to help if Night Shift is on at the same time. Also the mouse cursor size can be changed. But to keep the colors and cursor ok, we can also do a Screen Recording. However with screen recording there is an indicdator (image) on the top right of the screen. Maybe it can be disabled with SIP off but I haven't looked.

Essentially anything that forces the compositor(?) to do SW cursor (or whatever else) will do. No lag anymore.

Other idea:

Find out what's special about the Terminal window and create an app that does the same thing and overlays its window over everything.

Anyway, I chose Screen Recording.

My favorite "fix" right now: Screen Recording

For me, the Screen Recording solution is the least annoying one. The indicator (image) is small enough and we can turn off screen recording when a fullscreen video is playing (where the indicator would be annoying otherwise imho). Obviously, such a fix would invalidate the purpose of that indicator, but I think there are two kinds of indicators. There is a larger one also, which (I think) app store apps have, so I think we are fine-ish.

The cursor stops lagging.

It doesn't need much CPU/GPU:

Record 1 pixel every 10 seconds (to /dev/null basically, no SSD write)

Ok how to do it:

There is a script (create_unlag_neo_app.sh) below in this Gist. The script creates an .app which can be launched (no need for Dev Account or Xcode etc.).

The script can be used like this (Terminal):

chmod +x create_unlag_neo_app.sh
./create_unlag_neo_app.sh
# -> creates "Unlag Neo.app"

App that the script created:

image

Put Unlag Neo.app somewhere. In /Applications or something. Run it and give it the permission it wants.

In the menu bar (image) you can turn it off and also try the "Pause in Fullscreen" feature if you want, which does an OK job I think to hide the indicator. I tried with VLC and YouTube and a few apps.

image


[[Click here for Debug info]]

Debug

If you want to hack create_unlag_neo_app.sh and rebuild the app multiple times, macOS permission settings UI can reset and behave a bit weirdly. You can try to change "Unlag Neo" to something else in the script, or drag the app icon into permissions settings manually, or try to delete "~/Library/Preferences/Unlag Neo.plist" or killall cfprefsd or just use Xcode.

Hacker News · 152 赞 · 63 评 讨论 → 阅读原文 →

这条对你有帮助吗?