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

Unified Diff: chromeos/display/output_configurator.cc

Issue 13006006: chromeos: Support turning displays off in extended mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « no previous file | 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 b41362ff9657278b8fdc1ffc2178ada9a6b79700..6e9332707901cfa966fe368cd1243c4927c890fa 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -1141,13 +1141,14 @@ bool OutputConfigurator::EnterState(
RRCrtc secondary_crtc =
GetNextCrtcAfter(display, screen, outputs[1].output, primary_crtc);
- // Workaround for crbug.com/148365: leave internal display on for
- // internal-off, external-on so user can move cursor (and hence
- // windows) onto internal display even when it's off.
oshima 2013/03/25 22:20:40 I'm probably missing something but it sounds to me
Daniel Erat 2013/03/26 03:19:15 Yes, I was confused by this too. The old code see
bool primary_power_on = power_state == DISPLAY_POWER_ALL_ON ||
+ (power_state == DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON &&
+ !outputs[0].is_internal) ||
(power_state == DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF &&
outputs[0].is_internal);
bool secondary_power_on = power_state == DISPLAY_POWER_ALL_ON ||
+ (power_state == DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON &&
+ !outputs[1].is_internal) ||
(power_state == DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF &&
outputs[1].is_internal);
@@ -1203,15 +1204,26 @@ bool OutputConfigurator::EnterState(
secondary_power_on ? outputs[1].native_mode : None,
outputs[1].output);
- if (output_state == STATE_DUAL_EXTENDED)
- config2.y = primary_height + kVerticalGap;
- else
- config1.y = secondary_height + kVerticalGap;
+ if (output_state == STATE_DUAL_EXTENDED) {
oshima 2013/03/25 22:20:40 If we have two displays and not mirrored, it must
Daniel Erat 2013/03/26 03:19:15 Yeah, I think the only other state is one represen
+ if (primary_power_on)
+ config2.y = primary_height + kVerticalGap;
+ } else {
+ if (secondary_power_on)
+ config1.y = secondary_height + kVerticalGap;
+ }
int width = std::max<int>(
primary_mode_info->width, secondary_mode_info->width);
int height = primary_height + secondary_height + kVerticalGap;
+ if (primary_power_on && !secondary_power_on) {
+ width = primary_mode_info->width;
+ height = primary_height;
+ } else if (!primary_power_on && secondary_power_on) {
+ width = secondary_mode_info->width;
+ height = secondary_height;
+ }
+
CreateFrameBuffer(display, screen, window, width, height, &config1,
&config2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698