Don't reset the lastDeviceEventTime when doing DPMS actions
When we change the DPMS mode, don't play games with the last event time as this breaks applications using IDLETIME to turn the backlight off after a preset time. This patch fixes gnome-power-manager and xfce-power-manager Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
		
							parent
							
								
									dca4de72d3
								
							
						
					
					
						commit
						c1d901d723
					
				
							
								
								
									
										17
									
								
								Xext/dpms.c
								
								
								
								
							
							
						
						
									
										17
									
								
								Xext/dpms.c
								
								
								
								
							| 
						 | 
					@ -177,19 +177,10 @@ ProcDPMSForceLevel(ClientPtr client)
 | 
				
			||||||
    if (!DPMSEnabled)
 | 
					    if (!DPMSEnabled)
 | 
				
			||||||
	return BadMatch;
 | 
						return BadMatch;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (stuff->level == DPMSModeOn) {
 | 
					    if (stuff->level != DPMSModeOn &&
 | 
				
			||||||
      lastDeviceEventTime.milliseconds =
 | 
					        stuff->level != DPMSModeStandby &&
 | 
				
			||||||
          GetTimeInMillis();
 | 
					        stuff->level != DPMSModeSuspend &&
 | 
				
			||||||
    } else if (stuff->level == DPMSModeStandby) {
 | 
					        stuff->level != DPMSModeOff) {
 | 
				
			||||||
      lastDeviceEventTime.milliseconds =
 | 
					 | 
				
			||||||
          GetTimeInMillis() -  DPMSStandbyTime;
 | 
					 | 
				
			||||||
    } else if (stuff->level == DPMSModeSuspend) {
 | 
					 | 
				
			||||||
      lastDeviceEventTime.milliseconds =
 | 
					 | 
				
			||||||
          GetTimeInMillis() -  DPMSSuspendTime;
 | 
					 | 
				
			||||||
    } else if (stuff->level == DPMSModeOff) {
 | 
					 | 
				
			||||||
      lastDeviceEventTime.milliseconds =
 | 
					 | 
				
			||||||
          GetTimeInMillis() -  DPMSOffTime;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	client->errorValue = stuff->level;
 | 
						client->errorValue = stuff->level;
 | 
				
			||||||
	return BadValue;
 | 
						return BadValue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue