E_API void e_dpms_force_update(void) { unsigned int standby = 0, suspend = 0, off = 0; int enabled; enabled = ((e_config->screensaver_enable) && (!e_config->mode.presentation)); #ifndef HAVE_WAYLAND_ONLY if (e_comp_util_has_x()) ecore_x_dpms_enabled_set(enabled); #endif if (!enabled) return; if (e_config->screensaver_enable) { off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE); standby += 5; suspend += 6; off += 7; } #ifndef HAVE_WAYLAND_ONLY if (!e_comp_util_has_x()) return; ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10); ecore_x_dpms_timeouts_set(standby, suspend, off); #endif }
/** * Sets the off timeout (in unit of seconds). * @param new_timeout Amount of time of inactivity before the monitor is shut off. * @ingroup Ecore_X_DPMS_Group */ EAPI void ecore_x_dpms_timeout_off_set(unsigned int new_timeout) { unsigned int standby = 0, suspend = 0, off = 0; LOGFN(__FILE__, __LINE__, __FUNCTION__); ecore_x_dpms_timeouts_get(&standby, &suspend, &off); ecore_x_dpms_timeouts_set(standby, suspend, new_timeout); }
EAPI void e_dpms_force_update(void) { unsigned int standby = 0, suspend = 0, off = 0; int enabled; enabled = ((e_config->screensaver_enable) && (!e_config->mode.presentation)); ecore_x_dpms_enabled_set(enabled); if (!enabled) return; if (e_config->screensaver_enable) { off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE); standby += 5; suspend += 6; off += 7; } ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10); ecore_x_dpms_timeouts_set(standby, suspend, off); }
E_API void e_dpms_update(void) { unsigned int standby = 0, suspend = 0, off = 0; int enabled; Eina_Bool changed = EINA_FALSE; enabled = ((e_config->screensaver_enable) && (!e_config->mode.presentation) && ((!e_util_fullscreen_current_any()) && (!e_config->no_dpms_on_fullscreen)) ); if (_e_dpms_enabled != enabled) { _e_dpms_enabled = enabled; #ifndef HAVE_WAYLAND_ONLY if (e_comp_util_has_x()) ecore_x_dpms_enabled_set(enabled); #endif } if (!enabled) return; if (e_config->screensaver_enable) { off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE); standby += 5; suspend += 6; off += 7; } if (_e_dpms_timeout_standby != standby) { _e_dpms_timeout_standby = standby; changed = EINA_TRUE; } if (_e_dpms_timeout_suspend != suspend) { _e_dpms_timeout_suspend = suspend; changed = EINA_TRUE; } if (_e_dpms_timeout_off != off) { _e_dpms_timeout_off = off; changed = EINA_TRUE; } #ifndef HAVE_WAYLAND_ONLY if (e_comp_util_has_x()) { if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off); } #endif }