Red Hat Bugzilla – Bug 157501
Screensaver preferences does not accept 0 as a value for Power Management settings
Last modified: 2007-11-30 17:11:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050509 Fedora/1.0.3-5 Firefox/1.0.3
Description of problem:
The Screensaver preferences (xscreensaver-demo) does not allow a 0 value for any of the Power Management Standby, Suspend, Off settings on the Advanced tab. If you set one of those settings to 0 even though the others have valid non 0 values, when you exit the screensaver preferences and start it up again the Power Management is totally disabled(unchecked) and all values are set to 0. This behavior did not happen in Fedora Core 3. It would keep a setting at 0 if you set it to that because 0 is a valid value which means that specific Power Management feature should be disabled while others could still be used.
All the LCD monitors(Samsung SyncMaster 712N, Samsung SyncManster 770TFT) that I have do not support the 'Off After' setting. The monitor does not turn off... it just flashes an led light but it appears that the screen is still on(just blank).
I would setup Fedora Core 3 (xscreensaver 4.18) for a Standby of 45 minutes, Suspend After 60 minutes, and Off After of 0 so that the first two were enabled but the Off setting was disabled(set to 0). 0 is a valid value for any of those settings to disable that specific Power Management setting.
With FC4 it appears that all 3 settings have to be non zero or it disables all power management features.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run Screensaver preferences
2. Click on Advanced tab
3. Check Power Management Enabled
4. Set the Standby After setting to 15
5. Set the Suspend After setting to 20
6. Set the Off After setting to 0
7. Quit Screensaver preferences.
8. Run Screensaver preferences.
9. Go to the Advanced tab
10. Now Display Power Management feature is unchecked.
Actual Results: Power Management is unchecked(disabled fully) when you try to set one of the Power management settings to 0(disable that one setting).
Expected Results: Power Management should stay enabled and leave standby at 15, suspend at 20, and Off at 0 which means That standby and suspend is enabled but Off is disabled. 0 is a valid setting for xset command.
xset information from the man page of xset showing that 0 is a valid setting.
+dpms The +dpms option enables DPMS (Energy Star) features.
The dpms option allows the DPMS (Energy Star) parameters to be
set. The option can take up to three numerical values, or the
force flag followed by a DPMS state. The force flags
forces the server to immediately switch to the DPMS state spec-
ified. The DPMS state can be one of standby, suspend,
off, or on. When numerical values are given, they set the
inactivity period (in units of seconds) before the three modes
are activated. The first value given is for the standby
mode, the second is for the suspend mode, and the third is
for the off mode. Setting these values implicitly enables
the DPMS features. A value of zero disables a particular mode.
Created attachment 119343 [details]
Allow zero value for suspend, off in prefs
According to the DPMSLib.PS.gz (in xorg-x11-doc-6.8.2-52), the function
"DPMSSetTimeouts" (mainly called in sync_server_dpms_settings in
driver/dpms.c) behaves in the following way:
A: zero value is accepted for standby, suspend, off values
B: Aside for zero value, the order of 3 values should be:
standby <= suspend <= off; otherwise a "BadValue" error will result.
( These behavior can be checked by the return value of "xset dpms a b c ).
To follow B, driver/prefs.c is changed during xscreensaver version
4.18 and 4.21 so that for invarid values prefs.c corrects the values to
follow B; but prefs.c of 4.21 ( also 4.22 ) ignores the case A.
For now, if suspend is set as 0, standby is also set as 0 , and if
off is set as 0, both stanby and suspend is set as 0, which is the behavior
what Adam reported.
The patch attached is for prefs.c to accept zero value for suspend and off.
It should be applied in tomorrow's rawhide.