[gpm] Idle times confusion



Right, the user interface we have for user-idle is crap.

http://bugzilla.gnome.org/show_bug.cgi?id=446892

If clever guys like caillion and Jaap don't understand how the
screensaver and gnome-power-manager idle times interact, then for the
typical user this must be completely bewildering.

At the moment we have:

      * gnome-screensaver gives off SessionPowerManagementIdleChanged
        (bool) after a short delay. This lets g-p-m do idle dimming
        after a few seconds.
      * gnome-screensaver gives off SessionIdleChanged and we can query
        GetSessionIdleTime to see how long we are idle. g-s optionally
        starts the screensaver at this point, and g-p-m starts it's
        countdown for the screen to turn off. When the screen is off,
        and another countdown is finished then the system turns off.
      * gnome-screensaver has inhibit controls for stopping the screen
        blanking and gnome-power-manager has inhibit controls to stop
        the computer suspending.

It's basically a train wreck.

Before we talk about API, let's get the typical set of events:

User begins typing a letter. User walks away from computer. (don't worry
about times, as this will vary when on AC and DC)

Laptop

* 10 seconds screen is dimmed
* 1 minute screen is turned off and locked
* 10 minutes computer suspends

Workstation:

* 10 minute screensaver turns on and locked
* 60 minutes computer suspends

So the timeplan looks like:

start
|-----|----------|------------|
     DIM     screenoff    suspended

and the time valid for screensaver is:

|---screensaver--|

So, we look at how this fits into the UI. Currently we have "session
idle after" which means very little to me. I think it's important to
keep the distinction between screensaver and power manager different,
even if they do control one common resource, the screen.

Screensaver UI:

---------------------------------------------------------
                                  10 minutes
Start screensaver after ===============|=================
---------------------------------------------------------
or:
---------------------------------------------------------
                                                    Never
Start screensaver after ===============================|=
---------------------------------------------------------
or
---------------------------------------------------------
                          2 minutes
Start screensaver after ======|==========================
                        "Screensaver will not be shown as
                        this is less than display power off
                        time."
---------------------------------------------------------

The screensaver would *only* be started if the screen was not blanked,
as there is obviously little point.

Power Manager UI

---------------------------------------------------------
                                20 minutes
Turn off screen after ===============|=================
---------------------------------------------------------
or
---------------------------------------------------------
                                                    Never
Turn off screen       ===============================|=
---------------------------------------------------------

Thus the sliders go to one minute as most people expect.

So API:

      * gnome-screensaver controls session idle times and screensaver
        activation.
      * gnome-power-manager controls DPMS and panel dimming.

I propose for gnome-screensaver:

[signal] SessionIdleChanged(i) where (i) is the seconds since idle and
is emitted _every_ 30 seconds when idle with no starting delay. This
lets gnome-power-manager make decisions based on the value of (i)
trivially without setting up and maintaining 2 timers and statemachines
of its own.

If we inhibit gnome-screensaver then the session never goes idle, we
never get the idle signal, and thus gnome-power-manager doesn't do
anything either.

Much simpler than two signals, polling, and lots of complicated logic.
It also means that things should just work as expected. Yell if I've
missed something vital.

Sorry for the uber-long email but this needs lots of further thought and
comment before 2.20.0.

Thanks guys,

Richard.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]