Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: chromeos/display/output_configurator.cc

Issue 10989084: Handles the failures of output state change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 66a5b17601dbbe6e411cd19e90dd68635b581add..0754b2711b42ad7e7c9422993138454576580e8d 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -661,6 +661,9 @@ bool OutputConfigurator::CycleDisplayMode() {
XRRFreeScreenResources(screen);
XUngrabServer(display);
+
+ if (!did_change)
+ FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChangeFailed());
return did_change;
}
@@ -744,6 +747,7 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
XRRScreenResources* screen = GetScreenResourcesAndRecordUMA(display, window);
CHECK(screen != NULL);
+ bool did_change = false;
OutputSnapshot outputs[2] = { {0}, {0} };
connected_output_count_ =
GetDualOutputs(display, screen, &outputs[0], &outputs[1]);
@@ -754,10 +758,14 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
outputs,
connected_output_count_)) {
output_state_ = new_state;
+ did_change = true;
}
XRRFreeScreenResources(screen);
XUngrabServer(display);
+
+ if (!did_change)
+ FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChangeFailed());
return true;
}
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698