Change the DPMS initialization to be conditional on not set from config
Any DPMS timeout values set in ServerFlags section of the xorg.conf
are being overwritten by DPMS extension initialization.  Therefore
change the DPMS initialization of timeout values to be conditional on
not set from config.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106963
Signed-off-by: John Lumby <johnlumby@hotmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f5aace7a27)
			
			
This commit is contained in:
		
							parent
							
								
									8c2f0f8cbd
								
							
						
					
					
						commit
						394ed02f87
					
				
							
								
								
									
										16
									
								
								Xext/dpms.c
								
								
								
								
							
							
						
						
									
										16
									
								
								Xext/dpms.c
								
								
								
								
							| 
						 | 
					@ -45,9 +45,9 @@ Equipment Corporation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CARD16 DPMSPowerLevel = 0;
 | 
					CARD16 DPMSPowerLevel = 0;
 | 
				
			||||||
Bool DPMSDisabledSwitch = FALSE;
 | 
					Bool DPMSDisabledSwitch = FALSE;
 | 
				
			||||||
CARD32 DPMSStandbyTime;
 | 
					CARD32 DPMSStandbyTime = -1;
 | 
				
			||||||
CARD32 DPMSSuspendTime;
 | 
					CARD32 DPMSSuspendTime = -1;
 | 
				
			||||||
CARD32 DPMSOffTime;
 | 
					CARD32 DPMSOffTime = -1;
 | 
				
			||||||
Bool DPMSEnabled;
 | 
					Bool DPMSEnabled;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool
 | 
					Bool
 | 
				
			||||||
| 
						 | 
					@ -432,7 +432,15 @@ DPMSCloseDownExtension(ExtensionEntry *e)
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
DPMSExtensionInit(void)
 | 
					DPMSExtensionInit(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime;
 | 
					#define CONDITIONALLY_SET_DPMS_TIMEOUT(_timeout_value_)         \
 | 
				
			||||||
 | 
					    if (_timeout_value_ == -1) { /* not yet set from config */  \
 | 
				
			||||||
 | 
					        _timeout_value_ = ScreenSaverTime;                      \
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSStandbyTime)
 | 
				
			||||||
 | 
					    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSSuspendTime)
 | 
				
			||||||
 | 
					    CONDITIONALLY_SET_DPMS_TIMEOUT(DPMSOffTime)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DPMSPowerLevel = DPMSModeOn;
 | 
					    DPMSPowerLevel = DPMSModeOn;
 | 
				
			||||||
    DPMSEnabled = DPMSSupported();
 | 
					    DPMSEnabled = DPMSSupported();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue