[mythtv-users] Looking for opinions on implementing screensaver capability

Cliff Draper Cliff.Draper at Sun.COM
Mon Dec 22 17:21:02 EST 2003


From: "Joseph A. Caputo" <jcaputo1 at comcast.net>
Date: Mon, 22 Dec 2003 16:03:07 -0500
> On Monday 22 December 2003 15:25, Alan Snyder wrote:
> > 1.  Add xset calls directly in the code.  This would
> > allow things like blanking a screen left too long on
> > pause and so forth.  But it would require a patch to
> > every plugin to handle the screensave option.

This is the path I ended up taking.  I just sent a patch to mythtv-dev
for it.  I also wrapped util.cpp's myth_system call to disable the
screensaver then and restore it afterwards.  Works well for
MythVideo.  But you're right, any place that would like to have the
screensaver disabled, would need to call disable beforehand and
reenable afterwards; I don't think that's such a big deal.

> > 2. Add capabilities to myththemedmenu to allow screen
> > blanking options in menu items.  This may seem like an
> > odd approach, but it would allow screensave on/off to
> > behandled in the xml menus and therefore no patching
> > of any plugins.  On the other hand, screen saver of
> > blanking would be on a per-plugin basis and
> > within-plugin stuff like handling a paused video would
> > not be included.

Not quite as clean as the first option, but allows people who prefer
to code in XML over C++ to make the changes.  Also, doesn't solve
turning back on the screensaver while TV is paused.

> If you want my $.02, I think that direct Xt or Xlib calls should be made 
> instead of calling an external executable like xset.

Agreed.

>  Take a look at how Ogle does it.

I did study it.

>  Basically, if the screensaver is allowed (global 
> setting), then it will be enabled when mythfrontend starts up.  

My patch doesn't include a global option right now, but I suppose it
ought too....

> Certain 
> modules that wish to disable the screensaver (like NuppelVideoPlayer, 
> or mythmusic visualizations) would call a Myth function like 
> 'disable_screensaver' (a wrapper around Xlib/Xt calls) upon entry and 
> call 'restore_screensaver_setting' (basically the same code that would 
> be run on mythfrontend startup) on exit.

Agreed.

regards,
Cliff Draper    Sun Microsystems, Forte Tools
My opinions may or may not reflect those of my employer.
---------------------------- food for thought ---------------------------
"The one thing that unites all human beings, regardless of age,
gender, religion, economic status, or ethnic background, is that, deep
down inside, we ALL believe that we are above-average drivers." -Dave Barry


More information about the mythtv-users mailing list