Discussion:
expanding the inhibit spec
Michal Suchanek
2014-01-18 11:23:32 UTC
Permalink
Hello,

there is some problem with the archives so I can't read the whole
thread about this.
From the existing API I can see three things that are inhibited
- screen blank/lock
- system sleep (STR/hibernation)
- system shutdown
- logoff/user switch

and two ways to inhibit

- timeout - the operation is inhibited for certain amount of time
- permanent - the operation is inhibited until re-enabled

There generally exist three reasons to inhibit some action

1) an application is presenting information to the user without
requiring user interaction - such as a media player playing a movie, a
picture viewer showing a slideshow, etc. In this case the application
should assume the user is present and prevent that anything that would
happen as result of user idleness. If the application is not
scheduled, is locked up, stopped, or anything like that then it is not
presenting any information and hence has no reason to inhibit anything
anymore. Since the application simulates the user is active it only
requires a timeout as when activity ceases the powersaving and
security features should resume. The natural way is for the
application to ask the session manager to reset the idle timer as it
would reset when the user presses a key, moves a mouse, touches the
screen, etc.

Ideally, the session manager would be able to return the amount of
time in which some powersaving feature which inhibits the user from
using the application fully would kick in. When passing the message
through multiple intermediaries it might not always be possible to
determine the timeout so a save default would be something like 10s
given that some very aggressive powersaving features dim the display
in 30s on some devices. Also, the application would ideally reset the
timer when it's showing new content (eg. media player playing) and not
when this is not the case (eg. media player stopped). Also media
player playing audio only should request that the system should not
sleep or power off due to powersaving but should not prevent screen
dimming or system shutdown. Also the application should not be
required to explicitly name whet it prevents when it merely simulates
that the user is present.

2) an application is performing an operation that should not be
interrupted (eg. burning CD, installing package, ...) In this case the
application should inhibit changing system state permanently until the
operation is finished.

3) an application requires user action before system changes state
(eg. text editor that requires that file is either saved or discarded
before system is shut down). As has been pointed out enabling this can
change behaviour expected by the user - powering off the system should
power off but now an application can demand that the user decides what
the application does before system shuts down. This is definitely
something that should be mentioned in release notes but no behaviour
satisfies everyone. So long as it can be configured (turned
on/off/maybe with a timeout) it should be fine.

Note that 2) and 3) can be lumped together or handled differently. 2)
presumably does not need user input under normal circumstances but 3)
does require user input. The session manager should show some
information when attempting system state change inhibited by an
application which specifies what applications, and preferably for what
reason prevented the state change and should allow inspecting the
application in question or terminating it - possibly just by canceling
the state change and returning to the session or psesenting its own
UI. It should also allow just forcing the state change anyway.

Note also the difference between 1) and 2) 3). In 1) no user input is
received nor expected and the application wants to continue unimpeded
in spite of this. In 2) and 3) user input is received - such as
pressing the power button - and application interferes with the action
normally carried out when such input is received.

I am basically interested in 1) because I don't use features 2) and 3)
myself but I can understand they may be wanted in a desktop
environment and some users may learn to rely on them.

Thanks

Michal
Bastien Nocera
2014-01-21 07:09:20 UTC
Permalink
Post by Michal Suchanek
Hello,
there is some problem with the archives so I can't read the whole
thread about this.
From the existing API I can see three things that are inhibited
- screen blank/lock
- system sleep (STR/hibernation)
- system shutdown
- logoff/user switch
1, 2, 4, 3?

Also, we don't inhibit screen blank/screen lock. We inhibit idle.
Post by Michal Suchanek
Since the application simulates the user is active
No it doesn't. This isn't the 90's.

Please reply to the thread in the future instead of writing a new
e-mail.

Cheers
Michal Suchanek
2014-01-22 09:10:17 UTC
Permalink
Post by Bastien Nocera
Post by Michal Suchanek
Hello,
there is some problem with the archives so I can't read the whole
thread about this.
From the existing API I can see three things that are inhibited
- screen blank/lock
- system sleep (STR/hibernation)
- system shutdown
- logoff/user switch
1, 2, 4, 3?
These re just random things that you can do. Out of these sleep and
shutdown are clearly related because they happen in hardware. Screen
lock and user switch may or may not. Same for logoff/user switch and
the others.

For example you might want to save your work on user switch if you
have a screen/session lock that prevents the other users accessing
your session later but if your system does not have locking you might
want the system not bother you with that to make the switching faster.
Post by Bastien Nocera
Also, we don't inhibit screen blank/screen lock. We inhibit idle.
Post by Michal Suchanek
Since the application simulates the user is active
No it doesn't. This isn't the 90's.
Well, it does not use actual input events. However, the end result is
that the idle service which watches for user input to determine
non-idleness receives another kind of event from the application that
indicates that the user is not considered idle. As pointed out
inhibiting idleness indefinitely is not the way to go.
Post by Bastien Nocera
Please reply to the thread in the future instead of writing a new
e-mail.
Sorry, the downloadable archives are in unintelligible format and the
archive web interface does not support reply.

There is no practical way to reply to an email that did not arrive in my inbox.

Thanks

Michal
Bastien Nocera
2014-01-22 10:38:45 UTC
Permalink
Post by Michal Suchanek
Post by Bastien Nocera
Post by Michal Suchanek
Hello,
there is some problem with the archives so I can't read the whole
thread about this.
From the existing API I can see three things that are inhibited
- screen blank/lock
- system sleep (STR/hibernation)
- system shutdown
- logoff/user switch
1, 2, 4, 3?
These re just random things that you can do.
That's 4 things in your list of 3.
Post by Michal Suchanek
Out of these sleep and
shutdown are clearly related because they happen in hardware. Screen
lock and user switch may or may not. Same for logoff/user switch and
the others.
For example you might want to save your work on user switch if you
have a screen/session lock that prevents the other users accessing
your session later but if your system does not have locking you might
want the system not bother you with that to make the switching faster.
Post by Bastien Nocera
Also, we don't inhibit screen blank/screen lock. We inhibit idle.
Post by Michal Suchanek
Since the application simulates the user is active
No it doesn't. This isn't the 90's.
Well, it does not use actual input events. However, the end result is
that the idle service which watches for user input to determine
non-idleness receives another kind of event from the application that
indicates that the user is not considered idle. As pointed out
inhibiting idleness indefinitely is not the way to go.
Why is inhibiting idleness not the way to go? I can't see anywhere in
this mail that it's not the way to go. It's how we've implemented things
right now, and it work pretty well...
Post by Michal Suchanek
Post by Bastien Nocera
Please reply to the thread in the future instead of writing a new
e-mail.
Sorry, the downloadable archives are in unintelligible format and the
archive web interface does not support reply.
The downloadable archives are in mbox format, which your mail
application should be able to import.
Post by Michal Suchanek
There is no practical way to reply to an email that did not arrive in my inbox.
This is your e-mail:
http://thread.gmane.org/gmane.comp.freedesktop.xdg/13800/focus=13807

You can answer it there or using the NNTP interface.

Cheers

Loading...