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

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, 2 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..646b374ba3699021e326c23fc27a69a13d149e0f 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;
}
@@ -737,6 +740,9 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
output_state_ == STATE_SINGLE)
return false;
+ if (output_state_ == new_state)
+ return true;
+
Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
CHECK(display != NULL);
XGrabServer(display);
@@ -758,6 +764,9 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
XRRFreeScreenResources(screen);
XUngrabServer(display);
+
+ if (output_state_ != new_state)
+ 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