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

Unified Diff: monitor_reconfigure_main.cc

Issue 3709001: monitor_reconfig: Disable LCD when using external monitor. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222//monitor_reconfig.git
Patch Set: Created 10 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 | « no previous file | resolution_selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: monitor_reconfigure_main.cc
diff --git a/monitor_reconfigure_main.cc b/monitor_reconfigure_main.cc
index 64c7058fdb4f9edb5b3362f808470728f57882ae..664b05f33d279248c0e66c60441724c9f70d0ea4 100644
--- a/monitor_reconfigure_main.cc
+++ b/monitor_reconfigure_main.cc
@@ -52,14 +52,20 @@ void MonitorReconfigureMain::Run() {
&lcd_resolution,
&external_resolution,
&screen_resolution));
+ CHECK(!lcd_resolution.empty() || !external_resolution.empty());
- SetDeviceResolution(lcd_output_->name, lcd_resolution);
+ // Disable the LCD if we were told to do so (because we're using a higher
+ // resolution that'd be clipped on the LCD).
+ if (!lcd_resolution.empty())
+ SetDeviceResolution(lcd_output_->name, lcd_resolution);
+ else
+ DisableDevice(lcd_output_->name);
// If there's no external output connected, disable the device before we try
// to set the screen resolution; otherwise xrandr will complain if we're
// trying to set the screen to a smaller size than what the now-unplugged
// device was using.
- if (IsExternalMonitorConnected())
+ if (!external_resolution.empty())
SetDeviceResolution(external_output_->name, external_resolution);
else
DisableDevice(external_output_->name);
« no previous file with comments | « no previous file | resolution_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698