GNU bug report logs -
#63620
30.0.50; [Feature Request] run hooks on sleep/wake
Previous Next
Full log
View this message in rfc822 format
>>>>> "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.