frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

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

https://gist.github.com/retroplasma/ec21767d0a8380c7ea9c2fbee1c7d6bf
64•retroplasma•5h ago

Comments

m132•2h ago
Steve turning in his grave
InsideOutSanta•1h ago
Relevant quote from https://www.folklore.org/Shut_Up.html:

We showed [Gates] how the Macintosh mouse cursor moved smoothly, in a flicker-free fashion.

"What kind of hardware do you use to draw the cursor?", he asked. Many current personal computers had special hardware to draw small bitmaps called "sprites", and he thought we might be doing something similar.

Stitch4223•14m ago
This quote from 1981 stresses that taking away a responsive cursor is the most arrogant and disrespectful bug.

The audacity of developers to restart the discussion whether the mouse should follow user input induces rage on so many levels.

anotherpaul•1h ago
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
nehal3m•1h ago
You could just put it in your calendar. 'Check if that hacky bugfix at ~/.dirtyhack.sh is still required with chmod -x ~/.dirtyhack.sh'
joxdosba•1h ago
Or do a counter with read n<.hackycounter;echo $[n+1]>.hackycounter

When the counter hits e.g. 200, spam the user with notifications.

TheTon•1h ago
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.
nusl•15m ago
Terrible fix but it's a fix that's minimally-invasive and addresses a bug that causes a disproportionate annoyance to the fix. I can imagine your cursor lagging is something that is extremely annoying over time.
xnx•1h ago
Sometimes the cure is worse than the disease.
inigyou•1h ago
What's with "guard !foo else return" instead of "if foo return", is that just how Swift is written?
NobodyNada•1h ago
guard is an inverted if statement, with the additional requirement that the branch must exit the parent scope. It's useful sometimes for readability, particularly for avoiding the "pyramid of doom" when you have a lot of preconditions that need to be checked:

    if fooOK 
        if barOK {
            if bazOK {
                // do something
            }
        }
    }
can be written as:

    guard fooOK else { return }
    guard barOK else { return }
    guard bazOK else { return }
    // do something
Obviously there are other options (like writing a negated if), but sometimes guard is more readable. It's a style thing.

The more important use case for guard is that 'guard let' statements can pattern-match and introduce bindings that are valid for the rest of the scope:

    guard let foo = someOptional else { return }
    print(foo);
This is useful enough that Rust copied it in the form of 'let ... else {}' statements (but did not bring over boolean guard statements).
wwalexander•38m ago
guard has two advantages: the compiler ensures that you exit the current scope if the condition does not hold (via return, break, continue, etc), and bindings established in the guard clause (e.g. let foo = optionalBar) remaining in scope after the guard block, rather than inside it like an if block.
swiftcoder•1h ago
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?
adithyassekhar•1h ago
The duality of TheTon’s and anotherpaul’s comments.
userbinator•1h ago
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.

jstanley•59m ago
But wouldn't the software cursor operations also go in the queue? I don't see the problem.
userbinator•44m ago
For something as small as a cursor they could be doing direct framebuffer writes.
bloqs•25m ago
alvaniss•59m ago
ah yes, the famous mac "Just works" OS
zuhsetaqi•11m ago
Does anyone know if this is fixed in macOS 27?
This was a really informative and interesting reply articulated in simple enough terms that I am now interested in GPUs, thanks
charcircuit•17m ago
>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.

If a hardware layer is not being used the cursor layer will be treated like any other layer in the compositor. Modern compositors don't try and save and write pixels like that. It will just rerender it.

>(which is normally done per mouse interrupt);

It's normally done every frame the compositor makes.

>or it may end up drawing over what software wants to draw

The compositor composites everything at that will be shown on the next refresh of the display. Things don't indepently step on each others toes since it's just the compositor rendering and synchronizing all hardware layers (planes).

nok22kon•11m ago
how do hardware cursors work in a composited desktop?

the cursor could just be another small rectangle texture you position on top of the other surfaces. there is no need to read the framebuffer/write into it, its just a z-stack of 3d surfaces now

Vulnerability reports are not special anymore

https://words.filippo.io/vuln-reports/
228•goranmoomin•8h ago•122 comments

Raspberry Pi Pico W as USB Wi-Fi Adapter

https://gitlab.com/baiyibai/pico-usb-wifi
85•byb•4h ago•23 comments

Jerry's Map

http://www.jerrysmap.com/the-map
444•turtleyacht•13h ago•51 comments

FUTO Swipe – A new swipe typing model

https://swipe.futo.tech/
488•futohq•13h ago•148 comments

Show HN: An ASCII 3D Rendering Engine

https://glyphcss.com
76•apresmoi•3d ago•24 comments

Qwen-AgentWorld: Language World Models for General Agents

https://arxiv.org/abs/2606.24597
71•ilreb•5h ago•15 comments

Ashby (YC W19) Is Hiring EMEA Engineers Who Can Design

https://www.ashbyhq.com/careers?ashby_jid=87b96eef-edc1-4de4-adb6-d460126d02f8&utm_source=hn
1•abhikp•42m ago

In memory of the man who put red and green squiggles under words

https://devblogs.microsoft.com/oldnewthing/20260622-00/?p=112451
334•saikatsg•13h ago•44 comments

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

https://gist.github.com/retroplasma/ec21767d0a8380c7ea9c2fbee1c7d6bf
65•retroplasma•5h ago•25 comments

Remaking BBC test cards to teach you video processing

https://www.youtube.com/watch?v=U_6HxPkrgcg
19•unleaded•2d ago•0 comments

Printing Gaussian Splats

https://www.patreon.com/DanyBittel/posts/printing-splats-161333338
268•ilnmtlbnm•2d ago•30 comments

Rhombus Language 1.0

https://blog.racket-lang.org/2026/06/rhombus-v1.0.html
144•Decabytes•1d ago•32 comments

A man was gifted his dream car by Kevin Mitnick, who he helped put in prison

https://www.thedrive.com/news/this-man-was-gifted-his-dream-car-by-the-notorious-hacker-he-put-in...
153•mauvehaus•1d ago•86 comments

Swift Package Index joins Apple

https://swiftpackageindex.com/blog/swift-package-index-joins-apple
200•JDevlieghere•13h ago•66 comments

Usbliter8: an A12/A13 SecureROM Exploit

https://ps.tc/pages/blog-usbliter8.html
133•givinguflac•5d ago•27 comments

DiffusionBench: Towards Holistic Evaluation of Generative Diffusion Transformers

https://github.com/End2End-Diffusion/diffusion-bench
31•ilreb•5h ago•0 comments

Show HN: TikZ Editor – WYSIWYG editor for figures in LaTeX

https://tikz.dev/editor/
379•DominikPeters•17h ago•71 comments

Lithp.py (~2008)

https://fogus.me/fun/lithp/
13•wglb•2d ago•3 comments

The worthlessness of Vitamin D is mildly exaggerated

https://dynomight.net/vitamin-d/
280•surprisetalk•15h ago•189 comments

Meta Pauses Employee-Tracking Program Following Internal Data Leak

https://www.wired.com/story/meta-pauses-employee-tracking-program-following-internal-security-bre...
212•1vuio0pswjnm7•7h ago•130 comments

The Teensy Executable Revisited

https://www.muppetlabs.com/~breadbox/software/tiny/revisit.html
31•ankitg12•5h ago•3 comments

Show HN: Graphical SQL Builder and Debugger

https://github.com/webofmarius/SQLJoiner
4•matei88•1d ago•0 comments

Dirty Little Zine – a tool for making an 8 page printable Zine

https://dirtylittlezine.com/
110•cianmm•3d ago•13 comments

Millimeter wave technology drills 100 meters into granite

https://www.thinkgeoenergy.com/quaise-energy-achieves-100-meters-of-drilling-using-millimeter-wav...
139•Jimmc414•3d ago•40 comments

Inventing the Future, One Lisp Machine at a Time

https://www.patrickdomanico.com/bpm/2026/06/16/inventing-the-future-one-lisp-machine-at-a-time/
96•pamoroso•1d ago•11 comments

Fired by Google for creating the Google workspace CLI

https://twitter.com/JPoehnelt/status/2069482265953087602
468•justinwp•13h ago•287 comments

Hunting Million-Digit Primes from My Loft

https://primecrunch.com/blog/2/hunting-million-digit-primes-from-my-loft
20•andyhedges•2d ago•2 comments

The Low-Tech AI of Elden Ring

https://nega.tv/posts/low-tech-ai-of-elden-ring.html
138•g0xA52A2A•20h ago•69 comments

F* file system – file search that reads SSD directly bypassing OS kernel

https://github.com/dmtrKovalenko/ffs
58•neogoose•2d ago•38 comments

The war on terror primed America for autocracy

https://www.economist.com/by-invitation/2026/06/02/how-the-war-on-terror-primed-america-for-autoc...
193•andsoitis•5h ago•149 comments