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

Unified Diff: ui/display/manager/display_layout.cc

Issue 2518233002: Enable setting primary display for 3+ displays (Closed)
Patch Set: Oshima's comment Created 4 years, 1 month 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 | « ash/display/window_tree_host_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/manager/display_layout.cc
diff --git a/ui/display/manager/display_layout.cc b/ui/display/manager/display_layout.cc
index 25660de1af10c97f7f99a28c95d5557570c6a1ab..bfee319bd4d955b16f1b95234dd15bd3bc21e1ac 100644
--- a/ui/display/manager/display_layout.cc
+++ b/ui/display/manager/display_layout.cc
@@ -215,14 +215,14 @@ bool DisplayLayout::Validate(const DisplayIdList& list,
return true;
bool has_primary_as_parent = false;
- int64_t id = 0;
-
+ int64_t prev_id = std::numeric_limits<int64_t>::min();
for (const auto& placement : layout.placement_list) {
// Placements are sorted by display_id.
- if (id >= placement.display_id) {
+ if (prev_id >= placement.display_id) {
LOG(ERROR) << "PlacementList must be sorted by display_id";
return false;
}
+ prev_id = placement.display_id;
if (placement.display_id == kInvalidDisplayId) {
LOG(ERROR) << "display_id is not initialized";
return false;
« no previous file with comments | « ash/display/window_tree_host_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698