Basically every laptop I've owned I've had to disable sleep when the lid is closed as I often leave them plugged in and want background tasks like downloads or updates to be able to run while I'm not using the machine. However, I don't think PC laptops have a way to switch to a super low power state and just run background tasks like downloads, alarms and notifications or running scheduled tasks without just being left on in regular power mode. Why is this not just a default feature of laptops, given that phones and tablets have been doing this kind of thing for the last decade or more?

Does anyone know if there are plans to make power management for laptops allow for running certain tasks in Windows or Linux in the future? My smug Apple using friend tells me his Macbook already does this, but is the lack of this feature on PCs software related or something innate to x86 vs ARM architecture?

  • d3Xt3r@lemmy.nz
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    I haven’t developed a desktop app in ages so I’m probably not the best person to ask this, but my understanding is that if you develop a modern UWP app, then it’s automatically S0 aware, but you can also make use of WinRT APIs to execute background tasks during modern standby. The user can also choose whether or not to allow this activity.

    I’m not sure if the WinRT APIs can be called from a regular Win32 app though. For Win32 apps, as far as I’m aware, they should get suspended by the DAM automatically (and background services may get throttled), but Windows may choose to unsuspend/unthrottle these apps if it thinks some critical activities are happening. I never looked into what it deems as a “critical activity”. Personally though I always disable S0 so that my laptop suspends as you’d expect it to.

    Bottomline is, if you’re making a UWP app it should all just automatically work, maybe look into the WinRT APIs, and if you’re making a Win32 app you need to look more into the DAM. There’s some info on that here: https://learn.microsoft.com/en-us/windows/win32/w8cookbook/desktop-activity-moderator

    • fiat_lux@kbin.social
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Thanks so much, this is extremely helpful. I’ve been separate from the entire Windows ecosystem for a long while, so a high level overview like this is perfect. I now have all the acronyms and names I need to research further instead of trying to figure out what acronym is responsible for what, which is always the most tedious part.