Subject: Re: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake

From: Ship Mints <[email-masked]>
Date: Thu, 6 Feb 2025 10:40:18 -0500

On Thu, Feb 6, 2025 at 10:29 AM Eli Zaretskii <[email-masked]> wrote:

> > From: Ship Mints <[email-masked]>
> > Date: Thu, 6 Feb 2025 07:24:37 -0500
> > Cc: [email-masked], [email-masked], [email-masked],
> >       [email-masked]
> >
> > The API on macOS would expose a pair of C functions to lisp, one would
> inhibit sleep, perhaps returning an
> > opaque "cookie", the second to revoke the inhibition.
>
> Why would this have to be exposed to Lisp?  We want to make sure the
> system doesn't go to sleep until after the function invoked by the
> "about to go to sleep" event completes its job and exits, and for that
> all we need is to revoke the inhibition once the function exits, no?
>

That's right. The revocation on macOS requires calling an objective-c API
to relinquish the inhibition.