GNU bug report logs - #63620
30.0.50; [Feature Request] run hooks on sleep/wake

Previous Next

Package: emacs;

Reported by: Andrew Cohen <acohen <at> ust.hk>

Date: Sat, 20 May 2023 23:25:02 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Andrew Cohen <acohen <at> ust.hk>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 63620 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, Ship Mints <shipmints <at> gmail.com>, monnier <at> iro.umontreal.ca
Subject: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake
Date: Fri, 07 Feb 2025 22:41:39 +0800
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:

[...]

    EZ> For our reaction to the system's notification of an imminent
    EZ> sleep mode, I'm surprised that we'd need to block sleep up
    EZ> front.  It should not be needed.  Like macOS and MS-Windows, I
    EZ> believe GNU/Linux provides the application with an ability to
    EZ> delay sleep, so that the application could do what it needs in
    EZ> preparation for the sleep.

With logind, delaying sleep and blocking sleep are done in exactly the
same way: by calling an "Inhibit" method that returns a file
descriptor. Closing the descriptor removes the block and sleep can
proceed. The only difference is that with the delay case the sleep
proceeds after some (configurable) time even if the file descriptor is
not closed.

The documentation makes clear that the block (either for a hard block or
one with a delay) should be done at the time a monitor is installed to
watch for the sleep signal, and not wait for the signal to be generated,
which might be too late.

-- 
Andrew Cohen




This bug report was last modified 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.