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

Unified Diff: ash/display/display_change_observer_chromeos.cc

Issue 635403002: Preserve the native mode when parsing external display modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-hotplug-in-mirror-mode
Patch Set: . Created 6 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 | ash/display/display_change_observer_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_change_observer_chromeos.cc
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc
index cc30d1fd2926ef3c3d977c7dd20d8110ef44be26..047d903e8b434cf355a7be6f4bde63b8422f7337 100644
--- a/ash/display/display_change_observer_chromeos.cc
+++ b/ash/display/display_change_observer_chromeos.cc
@@ -136,6 +136,18 @@ std::vector<DisplayMode> DisplayChangeObserver::GetExternalDisplayModeList(
display_mode_list.push_back(iter->second);
}
+ if (output.display->native_mode()) {
+ const std::pair<int, int> size(native_mode.size.width(),
+ native_mode.size.height());
+ DisplayModeMap::iterator it = display_mode_map.find(size);
+ DCHECK(it != display_mode_map.end())
+ << "Native mode must be part of the mode list.";
+
+ // If the native mode was replaced re-add it.
+ if (!it->second.native)
+ display_mode_list.push_back(native_mode);
+ }
+
if (native_mode.size.width() >= kMinimumWidthFor4K) {
for (size_t i = 0; i < arraysize(kAdditionalDeviceScaleFactorsFor4k);
++i) {
« no previous file with comments | « no previous file | ash/display/display_change_observer_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698