DPMS: Simplify command line parsing
This commit is contained in:
parent
2d0a4fff79
commit
c1cf36ee29
|
@ -100,8 +100,7 @@ CARD32 defaultDPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
|
||||||
CARD32 defaultDPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
|
CARD32 defaultDPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
|
||||||
CARD16 DPMSPowerLevel = 0;
|
CARD16 DPMSPowerLevel = 0;
|
||||||
Bool defaultDPMSEnabled = TRUE;
|
Bool defaultDPMSEnabled = TRUE;
|
||||||
Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command */
|
Bool DPMSDisabledSwitch = FALSE;
|
||||||
Bool DPMSDisabledSwitch = FALSE; /* line switch states */
|
|
||||||
Bool DPMSCapableFlag = FALSE;
|
Bool DPMSCapableFlag = FALSE;
|
||||||
CARD32 DPMSStandbyTime;
|
CARD32 DPMSStandbyTime;
|
||||||
CARD32 DPMSSuspendTime;
|
CARD32 DPMSSuspendTime;
|
||||||
|
|
|
@ -64,8 +64,6 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
|
||||||
|
|
||||||
DPMSKey = &DPMSKeyIndex;
|
DPMSKey = &DPMSKeyIndex;
|
||||||
|
|
||||||
if (DPMSDisabledSwitch)
|
|
||||||
DPMSEnabled = FALSE;
|
|
||||||
if (!dixSetPrivate(&pScreen->devPrivates, DPMSKey,
|
if (!dixSetPrivate(&pScreen->devPrivates, DPMSKey,
|
||||||
xcalloc(sizeof(DPMSRec), 1)))
|
xcalloc(sizeof(DPMSRec), 1)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -74,9 +72,9 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
|
||||||
pScrn->DPMSSet = set;
|
pScrn->DPMSSet = set;
|
||||||
pDPMS->Flags = flags;
|
pDPMS->Flags = flags;
|
||||||
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
|
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
|
||||||
if (DPMSEnabledSwitch || DPMSDisabledSwitch) {
|
if (DPMSDisabledSwitch) {
|
||||||
enabled_from = X_CMDLINE;
|
enabled_from = X_CMDLINE;
|
||||||
DPMSEnabled = !DPMSDisabledSwitch && DPMSEnabledSwitch;
|
DPMSEnabled = FALSE;
|
||||||
}
|
}
|
||||||
else if (DPMSOpt) {
|
else if (DPMSOpt) {
|
||||||
enabled_from = X_CONFIG;
|
enabled_from = X_CONFIG;
|
||||||
|
|
|
@ -37,7 +37,6 @@ extern CARD32 DPMSOffTime;
|
||||||
extern CARD16 DPMSPowerLevel;
|
extern CARD16 DPMSPowerLevel;
|
||||||
extern Bool defaultDPMSEnabled;
|
extern Bool defaultDPMSEnabled;
|
||||||
extern Bool DPMSEnabled;
|
extern Bool DPMSEnabled;
|
||||||
extern Bool DPMSEnabledSwitch;
|
|
||||||
extern Bool DPMSDisabledSwitch;
|
extern Bool DPMSDisabledSwitch;
|
||||||
extern Bool DPMSCapableFlag;
|
extern Bool DPMSCapableFlag;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -487,7 +487,6 @@ void UseMsg(void)
|
||||||
ErrorF("-core generate core dump on fatal error\n");
|
ErrorF("-core generate core dump on fatal error\n");
|
||||||
ErrorF("-dpi int screen resolution in dots per inch\n");
|
ErrorF("-dpi int screen resolution in dots per inch\n");
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
ErrorF("dpms enables VESA DPMS monitor control\n");
|
|
||||||
ErrorF("-dpms disables VESA DPMS monitor control\n");
|
ErrorF("-dpms disables VESA DPMS monitor control\n");
|
||||||
#endif
|
#endif
|
||||||
ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
|
ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
|
||||||
|
@ -673,7 +672,7 @@ ProcessCommandLine(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
else if ( strcmp( argv[i], "dpms") == 0)
|
else if ( strcmp( argv[i], "dpms") == 0)
|
||||||
DPMSEnabledSwitch = TRUE;
|
/* ignored for compatibility */ ;
|
||||||
else if ( strcmp( argv[i], "-dpms") == 0)
|
else if ( strcmp( argv[i], "-dpms") == 0)
|
||||||
DPMSDisabledSwitch = TRUE;
|
DPMSDisabledSwitch = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user