X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fdpms.c;h=5d678f8c1bfbca892629a808058a526ff857d122;hp=570c2348083f1d11f02ac24413252ae03c55681a;hb=82c5080773aae5e72ec155327c075775e023d2ee;hpb=a445bdd3e3ba4abbee441844b6665b4c3c13d48c diff --git a/driver/dpms.c b/driver/dpms.c index 570c2348..5d678f8c 100644 --- a/driver/dpms.c +++ b/driver/dpms.c @@ -59,8 +59,17 @@ sync_server_dpms_settings (Display *dpy, Bool enabled_p, BOOL o_enabled = False; CARD16 o_power = 0; CARD16 o_standby = 0, o_suspend = 0, o_off = 0; + Bool bogus_p = False; - Bool bogus_p = (standby_secs == 0 || suspend_secs == 0 || off_secs == 0); + if (standby_secs == 0 && suspend_secs == 0 && off_secs == 0) + /* all zero implies "DPMS disabled" */ + enabled_p = False; + + else if ((standby_secs != 0 && standby_secs < 10) || + (suspend_secs != 0 && suspend_secs < 10) || + (off_secs != 0 && off_secs < 10)) + /* any negative, or any positive-and-less-than-10-seconds, is crazy. */ + bogus_p = True; if (bogus_p) enabled_p = False;