MonitorXrandr: fix reading the current DPMS level

Add missing break statements, to avoid falling always through
to the invalid case.

https://bugzilla.gnome.org/show_bug.cgi?id=706582
This commit is contained in:
Giovanni Campagna 2013-08-21 19:07:01 +02:00
parent 9198de7d45
commit 25ad3486a4

View File

@ -337,18 +337,23 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
dpms_enabled) dpms_enabled)
{ {
switch (dpms_state) switch (dpms_state)
{ {
case DPMSModeOn: case DPMSModeOn:
manager->power_save_mode = META_POWER_SAVE_ON; manager->power_save_mode = META_POWER_SAVE_ON;
case DPMSModeStandby: break;
manager->power_save_mode = META_POWER_SAVE_STANDBY; case DPMSModeStandby:
case DPMSModeSuspend: manager->power_save_mode = META_POWER_SAVE_STANDBY;
manager->power_save_mode = META_POWER_SAVE_SUSPEND; break;
case DPMSModeOff: case DPMSModeSuspend:
manager->power_save_mode = META_POWER_SAVE_OFF; manager->power_save_mode = META_POWER_SAVE_SUSPEND;
default: break;
manager->power_save_mode = META_POWER_SAVE_UNKNOWN; case DPMSModeOff:
} manager->power_save_mode = META_POWER_SAVE_OFF;
break;
default:
manager->power_save_mode = META_POWER_SAVE_UNKNOWN;
break;
}
} }
else else
{ {