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

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..f9565853360723d7999eaf10da41b4f211aed4a5 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -659,22 +659,32 @@ State OutputConfigurator::InferCurrentState(Display* display,
return state;
}
-bool OutputConfigurator::CycleDisplayMode() {
+bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) {
VLOG(1) << "CycleDisplayMode";
bool did_change = false;
+
if (is_running_on_chrome_os_) {
// Rules:
// - if there are 0 or 1 displays, do nothing and return false.
// - use y-coord of CRTCs to determine if we are mirror, primary-first, or
// secondary-first. The cycle order is:
// mirror->primary->secondary->mirror.
+ // Note: If the extended desktop is enabled, the cycle order becomes,
+ // mirror->extended->mirror
State new_state = STATE_INVALID;
switch (output_state_) {
case STATE_DUAL_MIRROR:
new_state = STATE_DUAL_PRIMARY_ONLY;
break;
case STATE_DUAL_PRIMARY_ONLY:
- new_state = STATE_DUAL_SECONDARY_ONLY;
+ if (extended_desktop_enabled) {
+ if (mirror_supported_)
+ new_state = STATE_DUAL_MIRROR;
+ else
+ new_state = STATE_INVALID;
+ } else {
+ new_state = STATE_DUAL_SECONDARY_ONLY;
+ }
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