expanding the inhibit spec
simon.mcvittie at collabora.co.uk
Tue Jan 7 10:42:33 PST 2014
On 07/01/14 18:16, Ryan Lortie wrote:
> I also find the use of "delay" inhibits to be slightly distasteful, at
> least for logout or shutdown. In my opinion, applications that want to
> do cleanup tasks on exit should register SIGTERM handlers and deal with
> them that way, exiting when done. I understand that it may be useful to
> know when the system about to suspend or hibernate, however, in order to
> sync up files on disk (just in case) or close network connections.
Delaying suspend is necessary if you want the screen to lock reliably,
to avoid this bug:
* system tells screensaver, asynchronously, "hey, I'm suspending"
* screensaver doesn't get scheduled because the system is busy
* system suspends
* system resumes (potentially after being stolen)
* user's secret files are briefly visible
* screensaver finally locks
That's why current GNOME uses that part of the logind interface.
Delaying logout/shutdown seems like the only way to get "save changes?"
prompts to work? Or do you think "authoring" applications (e.g. word
processor, image editor) should write out current unsaved state to some
sort of cache periodically or on SIGTERM, and restore it next time
they're run, like Firefox does?
(A word processor etc. blindly doing a normal "Save" when killed with
TERM doesn't seem good - if the user had intended to "Save As..." a
different filename, you've just overwritten the wrong file.)
More information about the xdg