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.
With the disclaimer that I have zero knowledge of the MacBook Neo hardware, but I do know a bit about GPUs in general (including having written some GPU-accelerated drivers for Windows and the associated cursor-handling code), I'm going to make a wild guess: this lag is caused by waiting for the GPU command queue to flush.
As a bit of background information: the GPU is fed commands from a queue that the CPU writes to. These commands perform the drawing operations that the GPU is designed to accelerate. A hardware cursor is basically a small bitmap that can be positioned anywhere on the screen and moved around by simply updating position registers (which is normally done per mouse interrupt); the hardware draws it automatically. A software cursor is manually drawn by the graphics stack, which saves what was under it, draws the cursor, and then whenever it needs to be moved, writes the original data back, saves the data at the new position, and then draws the cursor there.
Flushing the command queue is necessary when switching to a software cursor, or otherwise doing software writes to the framebuffer, because you need to wait for the GPU to finish drawing what it has queued, or it may end up drawing over what software wants to draw, including the cursor. Or worse, the command is a blit (e.g. scrolling a window) and you end up with remnants of the cursor at its previous position.
show comments
exogen
Before reading the background info, I was going to recommend a much simpler fix, but they actually already mention it in there: "Also the mouse cursor size can be changed."
This was going to be my suggestion because it also fixed a similar CPU/GPU related issue many years ago: Apple's own TV.app would have minuscule color handling differences whenever subtitles would show during a movie. This was driving me nuts while showing a moody black & white film for a movie night - every time a subtitle would pop up, the entire scene's black levels would shift slightly (and it wasn't any kind of adaptive/localized brightness or anything like that, it was the actual rendering).
Some online sleuthing revealed it was GPU related (pure GPU video decoding vs. the CPU overlaying subtitles on the screen), and that bumping up the cursor size (even the tiniest amount) in mouse settings would fix it. It worked.
It's barely noticeable, but I actually prefer the slightly bigger mouse cursor now anyway, so it's part of my standard macOS setup.
show comments
PaulHoule
One of the most damning indictments of current software architecture is the laggy mouse which we've all gotten used to on mainstream OS.
The other day my son and I were sitting in front of the XBOX ONE we (try to) use as a Plex client and laughing about how showing a new logo while the machine is doing something meaningless to us is an act of brand destruction and that they should be showing us a Playstation logo instead... And how with the NES you could just hit the power button and start playing. The cursor never lagged like that on the 1984 Mac.
show comments
TheTon
I’m not sure what the bug is, but this is a terrible fix. What this is doing is forcing the WindowServer to composite the cursor rather than treat it as a hardware overlay. I suppose the issue must be pretty bad for OP if this helps, but … ugh.
show comments
elicash
A fix so amusing and ridiculous it gets the bug enough attention that Apple fixes it for real.
whywhywhywhy
Crazy this would be the case when the MacOS cursor has been buttery smooth and only ever lags if the entire system is about to go down even on 800Mhz G4 Titanium Powerbook this was the behavior.
anotherpaul
This is such a nice fix but then you install it's set it up to launch on start and forget about it. 5 years later the bug has been fixed for 4 and I still have tho script record a random pixel every 10 seconds.
Never know how to know that the hacky fix is no longer needed
show comments
gcr
This is a great example of how to make a minimal app bundle with Swift. Thank you!
All an App needs on MacOS seems to be a binary and a little .plist
m132
Steve turning in his grave
show comments
gorfian_robot
reminds of a prank we pulled on a coworker back in the xterminal days. every time he hit a certain key it would invoke the 'melt' screensaver briefly. he was fairly unobservant though and we had to escalate to invoking it for 1s every minute before he finally noticed.
the follow on prank was having all the xterminals 'moo' whenever new code was deployed to prod.
show comments
mproud
Is there a Radar open for this?
xnx
Sometimes the cure is worse than the disease.
show comments
amelius
Bonus points if you manage to record the Facebook tracking pixel.
show comments
vardump
Embedded Swift in a script. That seems like a useful concept for small scripts on macOS. I will definitely steal this idea.
show comments
zuhsetaqi
Does anyone know if this is fixed in macOS 27?
swiftcoder
Is the fix working because it forces the WindowServer to do a full composition of the cursor overlay, or just because it prevents the system from throttling down into a lower power mode?
zx8080
Round rect corners are to blame?
The root cause for the issue is probably (I'm not an Apple developer) due to huge round rectangles on the window shape corners. Rendering the window with the corners would include rendering whatever other windows and widgets under the window. (Which will have a lag and some more operations with transparency, which the developers probably want to avoid - while I'm not sure about this part).
show comments
inigyou
What's with "guard !foo else return" instead of "if foo return", is that just how Swift is written?
show comments
taude
I'm on a NEO right now, my Chrome has like 25 tabs open. Doom Emacs running in terminal, Obsidian open, Apple Music, Apple NOtes, etc. I have a lot open...
AND I'm not seeing this issue. What am I missing?
I'm on 26.4.
:shrugs:
EDIT: I guess I wait to update and install the latest version? Maybe the linked page could have stated there's a new regression in newer MacOS versions that introduced this?
ing33k
is any one here using the neo for any coding work ? how is it ?
show comments
adithyassekhar
The duality of TheTon’s and anotherpaul’s comments.
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.
With the disclaimer that I have zero knowledge of the MacBook Neo hardware, but I do know a bit about GPUs in general (including having written some GPU-accelerated drivers for Windows and the associated cursor-handling code), I'm going to make a wild guess: this lag is caused by waiting for the GPU command queue to flush.
As a bit of background information: the GPU is fed commands from a queue that the CPU writes to. These commands perform the drawing operations that the GPU is designed to accelerate. A hardware cursor is basically a small bitmap that can be positioned anywhere on the screen and moved around by simply updating position registers (which is normally done per mouse interrupt); the hardware draws it automatically. A software cursor is manually drawn by the graphics stack, which saves what was under it, draws the cursor, and then whenever it needs to be moved, writes the original data back, saves the data at the new position, and then draws the cursor there.
Flushing the command queue is necessary when switching to a software cursor, or otherwise doing software writes to the framebuffer, because you need to wait for the GPU to finish drawing what it has queued, or it may end up drawing over what software wants to draw, including the cursor. Or worse, the command is a blit (e.g. scrolling a window) and you end up with remnants of the cursor at its previous position.
Before reading the background info, I was going to recommend a much simpler fix, but they actually already mention it in there: "Also the mouse cursor size can be changed."
This was going to be my suggestion because it also fixed a similar CPU/GPU related issue many years ago: Apple's own TV.app would have minuscule color handling differences whenever subtitles would show during a movie. This was driving me nuts while showing a moody black & white film for a movie night - every time a subtitle would pop up, the entire scene's black levels would shift slightly (and it wasn't any kind of adaptive/localized brightness or anything like that, it was the actual rendering).
Some online sleuthing revealed it was GPU related (pure GPU video decoding vs. the CPU overlaying subtitles on the screen), and that bumping up the cursor size (even the tiniest amount) in mouse settings would fix it. It worked.
It's barely noticeable, but I actually prefer the slightly bigger mouse cursor now anyway, so it's part of my standard macOS setup.
One of the most damning indictments of current software architecture is the laggy mouse which we've all gotten used to on mainstream OS.
The other day my son and I were sitting in front of the XBOX ONE we (try to) use as a Plex client and laughing about how showing a new logo while the machine is doing something meaningless to us is an act of brand destruction and that they should be showing us a Playstation logo instead... And how with the NES you could just hit the power button and start playing. The cursor never lagged like that on the 1984 Mac.
I’m not sure what the bug is, but this is a terrible fix. What this is doing is forcing the WindowServer to composite the cursor rather than treat it as a hardware overlay. I suppose the issue must be pretty bad for OP if this helps, but … ugh.
A fix so amusing and ridiculous it gets the bug enough attention that Apple fixes it for real.
Crazy this would be the case when the MacOS cursor has been buttery smooth and only ever lags if the entire system is about to go down even on 800Mhz G4 Titanium Powerbook this was the behavior.
This is such a nice fix but then you install it's set it up to launch on start and forget about it. 5 years later the bug has been fixed for 4 and I still have tho script record a random pixel every 10 seconds. Never know how to know that the hacky fix is no longer needed
This is a great example of how to make a minimal app bundle with Swift. Thank you!
All an App needs on MacOS seems to be a binary and a little .plist
Steve turning in his grave
reminds of a prank we pulled on a coworker back in the xterminal days. every time he hit a certain key it would invoke the 'melt' screensaver briefly. he was fairly unobservant though and we had to escalate to invoking it for 1s every minute before he finally noticed.
the follow on prank was having all the xterminals 'moo' whenever new code was deployed to prod.
Is there a Radar open for this?
Sometimes the cure is worse than the disease.
Bonus points if you manage to record the Facebook tracking pixel.
Embedded Swift in a script. That seems like a useful concept for small scripts on macOS. I will definitely steal this idea.
Does anyone know if this is fixed in macOS 27?
Is the fix working because it forces the WindowServer to do a full composition of the cursor overlay, or just because it prevents the system from throttling down into a lower power mode?
Round rect corners are to blame?
The root cause for the issue is probably (I'm not an Apple developer) due to huge round rectangles on the window shape corners. Rendering the window with the corners would include rendering whatever other windows and widgets under the window. (Which will have a lag and some more operations with transparency, which the developers probably want to avoid - while I'm not sure about this part).
What's with "guard !foo else return" instead of "if foo return", is that just how Swift is written?
I'm on a NEO right now, my Chrome has like 25 tabs open. Doom Emacs running in terminal, Obsidian open, Apple Music, Apple NOtes, etc. I have a lot open...
AND I'm not seeing this issue. What am I missing?
I'm on 26.4.
:shrugs:
EDIT: I guess I wait to update and install the latest version? Maybe the linked page could have stated there's a new regression in newer MacOS versions that introduced this?
is any one here using the neo for any coding work ? how is it ?
The duality of TheTon’s and anotherpaul’s comments.
ah yes, the famous mac "Just works" OS
i hope they can fix it asap