suspend/hibernate support in xfce4-session

Brian J. Tarricone bjt23 at cornell.edu
Sun Nov 2 19:35:14 CET 2008


On Sun, 02 Nov 2008 12:45:34 +0100 jp.guillemin wrote:

> Yves-Alexis Perez wrote:
> > On dim, 2008-11-02 at 12:22 +0100, jp.guillemin wrote:
> >   
> >> OK, no problem, please send me a patch for all concerned alsa
> >> drivers. Or a method to unload a sound module while the panel
> >> applet is polling it.
> >>     
> > Maybe opening a but on the kernel bugzilla would be a better method
> > than ranting on an unrelated list?
> >   
> This is absolutely related to a late and unexpected change in 
> xfce-session which oblige me to deal with a problem. I have to solve 
> this problem, else several thousand Zenwalk users will kick me :)

No, you don't.  This is an unfortunate side-effect of an ADDED FEATURE.
If the feature does not work the way you expect, you are free to
disable it (you can do so by setting default xfconf poperties:
set /shutdown/ShowHibernate and /shutdown/ShowSuspend on the
xfce4-session channel to FALSE).  Your choice to try to find a hacky and
IMHO inappropriate workaround to the problem is... your choice.

And I doubt "several thousand" users will have the problem, seeing as
this only occurs if an app has the sound device open when the user
ties to suspend or hibernate, which I'd bet won't be the case for many
people.

> The best solution I could think of , would be to have an "option" in 
> xfce-session that would stop the panel when suspend or hibernate are 
> chosen, and restart it after resume . It would be cleaner, and
> wouldn't hurt people using pm-utils, who have the same problem.

No, that's an ugly hack to work around to a problem that needs to be
fixed elsewhere.  If the ALSA devs really refuse to fix this problem,
the correct solution is to implement a way for apps to get signaled
that a suspend/hibernate is about to happen so they can do any cleanup
to ensure that the suspend will succeed, and then they need another
signal on wakeup (or on suspend failure) so they can undo that.  Then
the mixer plugin can release and reacquire the sound device as
appropriate.

I'd maybe -- MAYBE -- consider adding some hooks to xfce4-session to
allow people to execute arbitrary scripts before suspend/hibernate and
after wakeup, but this is definitely not something for 4.6.  Even then,
the correct use of this hypothetical feature would be to somehow
instruct the mixer to close the sound device (no, there isn't a way to
currently do this, AFAIK), NOT to kill the panel.

> In fact , it wouldn't hurt anyone imho.

Actually, it would.  There are still applications out there that have
system tray icons that don't respond well to the system tray
disappearing.  Quitting the panel on suspend would likely cause
problems for those apps.  Try to think about other possible
side-effects of making crappy workarounds -- these kinds of things
*always* happen when you do that.

	-brian



More information about the Xfce4-dev mailing list