And also it has a magnet to detect the lid being closed. People think this is over engineered, but I've yet to see another brand that has a working closed lid detection
With both Windows and Linux, it's always a luck-of-the-draw thing. Sometimes closing the lid works perfectly, sometimes you get a doofus manufacturer with lousy drivers, so 1 in 20 times you pull your laptop out of your bag and it's red hot with a drained battery.
It's maddening that only Apple gets this right 100% of the time, and it's among the things keeping me on Apple's platform for the moment. I can't fathom why this isn't a bigger priority for everyone else: much like "trackpads that don't suck", it's a huge quality-of-life thing which keeps tons of people on Macs because they want it to Just Work without ever thinking about it.
>sometimes you get a doofus manufacturer with lousy drivers, so 1 in 20 times you pull your laptop out of your bag and it's red hot with a drained battery.
That's due to "connected standby"[1], which is to have laptops behave more like a phone when in sleep. This is in contrast to S3 sleep, which basically halts all activity. Sounds all good in theory, but as soon as you allow code to be run while in sleep, it's easy for some runaway app (OS or third party) to eat through your battery even while your laptop is "sleeping". Worse is that there's no way to force sleep, so your only choice is hibernate, which is even worse than S3 sleep before.
“Modern standby” is indeed the culprit in many cases, maybe even the primary one these days, but to my understanding it can still be a crapshoot on laptops that support S3 sleep since it’s up to the OS to detect that the lid has been closed and put the machine to sleep. This has been a problem for a very long time, since well before it became cool to pretend to be a smartphone and not actually sleep the machine.
There’s also wake on LAN which if enabled can rouse the machine from sleep after it’s successfully entered a sleep state.
Source: My macbook has drained its battery flat while closed in my bag dozens of times. Then it just stopped doing that on an OS update. I still have no idea why.
For a long time (years) there was a bug in Firefox that'd prevent a Windows machine from going to sleep if webgl content was loaded in any FF tab.
So anyway that killed one of my laptop's batteries. So much for supporting Internet freedoms...
Windows comes with a utility that'll tell you what process denied a sleep request, super useful.
I've actually ran into MacBooks not sleeping a few times, but it is much rarer.
It is unfortunate because back on the mid 2000s windows had the best functioning sleep code, but then they tried to catch up with iPad's # instant on and chasing perfection led to the current mess.
The old Intel models were hit or miss, but with the M-series models I’ve never had problems with MacBooks not going to sleep when the lid is shut and staying that way so long as wake on LAN is disabled (or disabled on battery). That setting does need to be off though, with it on I did observe occasional misbehavior.
What makes you think that these issues you describe (which I've experienced too, FWIW) are problems related to the sensor rather than the OS or drivers?
I don't think this is about the hardware driver detection of the lid closing. Lid events are a first-class thing in ACPI and I've never seen a laptop that didn't have one, or any real evidence that one didn't do the thing.
Much more likely is that the OS was prevented from going to sleep by some badly behaved process, or got woken up by another thing like allowing USB to wake it from sleep, where even touching the mouse can wake it - with some laptop equivalent like a ghost touchpad touch or whatever.
The magnets work too well. Having one Thinkpad Yoga sat on top of another closed Yoga tricks the sensor into thinking it's in tablet mode and it disables the keyboard. I only lost 30min or so trying to work out what was happening...
There's decent reasons to over-engineer some of these sensors so they can't be unduly tricked by external influences.
If you're talking about laptops waking up inside backpacks- that's due to the terrible implementation of "Windows Modern Standby" that has ruined every laptop except Macbooks and Framework. (Framework still implements legacy S3 standby to improve compatibility with Linux.)
This has been an issue for so long - who is at fault? Is it hardware vendors or software? The spec itself is so bad that all implementations will disagree?
Halting power until an external physical event seems like a simple enough idea. I have never wanted to close my laptop and let it keep number crunching.
I've also found my work MacBook Pro heating up my backpack sleeve a number of times because it didn't properly go to sleep. Likely culprit is some "security" spyware the company installs.