ecore-x - add ecore x dpms force api

add api that allows us to force dpms on or off. needed to fix e
support for non-suspend new systems that don't do S3 ...

@feature
This commit is contained in:
Carsten Haitzler 2017-07-04 14:49:37 +09:00
parent 0735f6aa61
commit 52fdb5e830
2 changed files with 17 additions and 0 deletions

View File

@ -2526,6 +2526,7 @@ EAPI unsigned int ecore_x_dpms_timeout_off_get(void);
EAPI void ecore_x_dpms_timeout_standby_set(unsigned int new_timeout);
EAPI void ecore_x_dpms_timeout_suspend_set(unsigned int new_timeout);
EAPI void ecore_x_dpms_timeout_off_set(unsigned int new_timeout);
EAPI void ecore_x_dpms_force(Eina_Bool on);
EAPI Eina_Bool ecore_x_test_fake_key_down(const char *key);
EAPI Eina_Bool ecore_x_test_fake_key_up(const char *key);

View File

@ -283,3 +283,19 @@ ecore_x_dpms_timeout_off_set(unsigned int new_timeout)
DPMSSetTimeouts(_ecore_x_disp, standby, suspend, new_timeout);
#endif /* ifdef ECORE_XDPMS */
}
/**
* Forces DPMS on or off
* @param on If DPMS is to be forced on (EINA_TRUE) or forced off
* @ingroup Ecore_X_DPMS_Group
*/
EAPI void
ecore_x_dpms_force(Eina_Bool on)
{
#ifdef ECORE_XDPMS
LOGFN(__FILE__, __LINE__, __FUNCTION__);
EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
if (on) DPMSForceLevel(_ecore_x_disp, DPMSModeOn);
else DPMSForceLevel(_ecore_x_disp, DPMSModeOff);
#endif /* ifdef ECORE_XDPMS */
}