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

Unified Diff: chromeos/display/output_configurator.cc

Issue 10829026: Fix display switching for extended displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 60013092234cbe9ba6612111b451f5159126c88e..a22937364a11cc47554c1ae5fd1319b77af45874 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -659,9 +659,22 @@ State OutputConfigurator::InferCurrentState(Display* display,
return state;
}
-bool OutputConfigurator::CycleDisplayMode() {
+bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) {
VLOG(1) << "CycleDisplayMode";
bool did_change = false;
+
+ // The next state to go into if the current state is dual primary.
+ State next_state_from_dual_primary = STATE_DUAL_SECONDARY_ONLY;
+ if (extended_desktop_enabled) {
+ if (mirror_supported_) {
+ next_state_from_dual_primary = STATE_DUAL_MIRROR;
+ } else {
+ // In case mirror is not supported, stay in the
+ // extended desktop primary display.
+ next_state_from_dual_primary = STATE_INVALID;
+ }
+ }
Josh Horwich 2012/07/26 00:18:26 Would this be easier to follow if you just put it
rkc 2012/07/26 00:32:52 The ?:'s seemed kinda ugly so I moved it in the sw
+
if (is_running_on_chrome_os_) {
// Rules:
// - if there are 0 or 1 displays, do nothing and return false.
@@ -674,7 +687,7 @@ bool OutputConfigurator::CycleDisplayMode() {
new_state = STATE_DUAL_PRIMARY_ONLY;
break;
case STATE_DUAL_PRIMARY_ONLY:
- new_state = STATE_DUAL_SECONDARY_ONLY;
+ new_state = next_state_from_dual_primary;
break;
case STATE_DUAL_SECONDARY_ONLY:
new_state = mirror_supported_ ?
« 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