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

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

Issue 2573673003: Detect and fix overlapping displays (Closed)
Patch Set: Fix compile on Windows Created 4 years 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
« ui/display/display_layout.cc ('K') | « ui/display/manager/display_manager.h ('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_manager.cc
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc
index 6d3e03ab020d8d978db535f84b075c6ddaddefaa..2639f35fa0d7c07773d14e7bd7a4ab5dc6908acc 100644
--- a/ui/display/manager/display_manager.cc
+++ b/ui/display/manager/display_manager.cc
@@ -206,6 +206,11 @@ const DisplayLayout& DisplayManager::GetCurrentDisplayLayout() const {
return layout;
}
+const DisplayLayout& DisplayManager::GetCurrentResolvedDisplayLayout() const {
+ return current_resolved_layout_ ? *current_resolved_layout_
+ : GetCurrentDisplayLayout();
+}
+
DisplayIdList DisplayManager::GetCurrentDisplayIdList() const {
if (IsInUnifiedMode()) {
return CreateDisplayIdList(software_mirroring_display_list_);
@@ -244,7 +249,8 @@ void DisplayManager::SetLayoutForCurrentDisplays(
// TODO(oshima): Call UpdateDisplays instead.
std::vector<int64_t> updated_ids;
- ApplyDisplayLayout(GetCurrentDisplayLayout(), &active_display_list_,
+ current_resolved_layout_ = GetCurrentDisplayLayout().Copy();
+ ApplyDisplayLayout(current_resolved_layout_.get(), &active_display_list_,
&updated_ids);
for (int64_t id : updated_ids) {
NotifyMetricsChanged(GetDisplayForId(id),
@@ -1379,7 +1385,8 @@ void DisplayManager::UpdateNonPrimaryDisplayBoundsForLayout(
// display_list does not have translation set, so ApplyDisplayLayout cannot
// provide accurate change information. We'll find the changes after the call.
- ApplyDisplayLayout(layout, display_list, nullptr);
+ current_resolved_layout_ = layout.Copy();
+ ApplyDisplayLayout(current_resolved_layout_.get(), display_list, nullptr);
size_t num_displays = display_list->size();
for (size_t index = 0; index < num_displays; ++index) {
const Display& display = (*display_list)[index];
@@ -1399,11 +1406,11 @@ void DisplayManager::CreateMirrorWindowIfAny() {
delegate_->CreateOrUpdateMirroringDisplay(list);
}
-void DisplayManager::ApplyDisplayLayout(const DisplayLayout& layout,
+void DisplayManager::ApplyDisplayLayout(DisplayLayout* layout,
Displays* display_list,
std::vector<int64_t>* updated_ids) {
- layout.ApplyToDisplayList(display_list, updated_ids,
- kMinimumOverlapForInvalidOffset);
+ layout->ApplyToDisplayList(display_list, updated_ids,
+ kMinimumOverlapForInvalidOffset);
}
void DisplayManager::RunPendingTasksForTest() {
« ui/display/display_layout.cc ('K') | « ui/display/manager/display_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698