Commit 68d4c698 authored by Sean Davis's avatar Sean Davis 🕶

Do not activate DPMS changes if the screensaver is not active; improve logging

parent 50387ac5
......@@ -381,8 +381,6 @@ gs_listener_activate_saver (GSListener *listener,
g_return_val_if_fail (GS_IS_LISTENER (listener), FALSE);
if (listener->priv->active == active) {
gs_debug ("Trying to set active state when already: %s",
active ? "active" : "inactive");
return FALSE;
}
......
......@@ -557,17 +557,19 @@ activate_dpms_timeout (GSManager *manager) {
BOOL state;
CARD16 power_level;
if (DPMSInfo(gdk_x11_get_default_xdisplay(), &power_level, &state)) {
if (state) {
if (power_level == DPMSModeOn) {
gs_debug("DPMS: On -> Standby");
DPMSForceLevel (gdk_x11_get_default_xdisplay(), DPMSModeStandby);
remove_dpms_timer (manager);
add_dpms_timer (manager, manager->priv->prefs->dpms_off_timeout);
return FALSE;
} else if (power_level == DPMSModeStandby || power_level == DPMSModeSuspend) {
gs_debug("DPMS: %s -> Off", power_level == DPMSModeStandby ? "Standby" : "Suspend");
DPMSForceLevel (gdk_x11_get_default_xdisplay(), DPMSModeOff);
if (manager->priv->active) {
if (DPMSInfo(gdk_x11_get_default_xdisplay(), &power_level, &state)) {
if (state) {
if (power_level == DPMSModeOn) {
gs_debug("DPMS: On -> Standby");
DPMSForceLevel (gdk_x11_get_default_xdisplay(), DPMSModeStandby);
remove_dpms_timer (manager);
add_dpms_timer (manager, manager->priv->prefs->dpms_off_timeout);
return FALSE;
} else if (power_level == DPMSModeStandby || power_level == DPMSModeSuspend) {
gs_debug("DPMS: %s -> Off", power_level == DPMSModeStandby ? "Standby" : "Suspend");
DPMSForceLevel (gdk_x11_get_default_xdisplay(), DPMSModeOff);
}
}
}
}
......@@ -593,7 +595,7 @@ add_dpms_timer (GSManager *manager,
if (timeout == 0)
return;
gs_debug ("Scheduling DPMS change after screensaver is idling for %i minute", timeout);
gs_debug ("Scheduling DPMS change after screensaver is idling for %i minute(s)", timeout);
manager->priv->dpms_timeout_id = g_timeout_add (timeout * 60000,
(GSourceFunc)activate_dpms_timeout,
manager);
......
......@@ -1602,6 +1602,10 @@ gs_window_set_lock_active (GSWindow *window,
gboolean active) {
g_return_if_fail (GS_IS_WINDOW (window));
if (window->priv->lock_active == active) {
return;
}
gs_debug("Setting lock active: %i", active);
window->priv->lock_active = active;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment