org.freedesktop.PowerManagement

Dan Winship danw at gnome.org
Sun Apr 1 18:24:10 EEST 2007


David Zeuthen wrote:
> two specs then:
> 
>  org.freedesktop.PowerManagement - but without Shutdown() and Reboot()
> 
> and this one
> 
>  org.freedesktop.SessionManagement
>    Shutdown()
>    Reboot()
>    Logout()
>    Inhibit(String app, String reason)
> 
> See [1] for discussion on nomenclature.
> 
> The way this could work is then that org.fd.PM.Inhibit() would also call
> Inhibit() on org.fd.SM. Specifically, as you mention, existing PM
> daemons like gnome-power-manager, kpowersave etc. would just provide
> both "interfaces" until something better comes along to provide
> org.freedesktop.SessionManagement, e.g. for GNOME it would probably be a
> future version of gnome-session.

It doesn't have to be a future version (or at least, not any farther
into the future than the version of g-p-m that supports o.f.PM).
Shutdown(), Reboot() and Logout() are just alternate ways of invoking
existing functionality, so they'd be one-liners. And the code to
implement Inhibit is pretty much the same whether you put it in g-p-m or
gnome-session. So really, the hardest part of implementing the interface
in gnome-session right away would be the dbus glue. Which isn't that big
a difficulty.

(And ksmserver in KDE4 already has a D-Bus method for shutdown, reboot,
and logout, so it would be even less work for them.)

> Would this work for everyone? Personally I think this is a lot nicer.

Yes, pretty much. We need to move CanShutdown and CanReboot to o.f.SM
too, so that callers know whether or not to offer those options to the
user. (The CanShutdownChanged and CanRebootChanged signals seem like
overkill...)

Also, does Logout() mean "ask if the user wants to log out" or just "log
out!" IOW, who does the confirmation dialogs, the caller or the session
manager? Or should there be a "bool ask_for_confirmation" flag? And
should there be a generic "pop up a dialog to let the user pick whether
to log out, reboot, or shut down" method? (GNOME has moved towards
having the callers do the dialogs themselves in recent releases, but the
session manager needs to have its own dialogs anyway to properly deal
with logout requests from XSMP clients, so it seems to me like it would
make more sense to move gnome-panel's logout/reboot/shutdown dialogs
into gnome-session.)

Also, at the risk of infinite regress, should there be an
org.freedesktop.LoginManager interface, to standardize the communication
between the session manager and gdm/kdm about reboot and shutdown?

-- Dan



More information about the xdg mailing list