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

Unified Diff: ash/display/display_manager.cc

Issue 1133323002: Close mirroring window only when necessary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « ash/display/display_manager.h ('k') | ash/display/mirror_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index f67c62faaccf72375d68f131e45da62748c47794..09d084e9817dc3a4a3d0019fbccbe2bad154bf23 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -673,12 +673,13 @@ void DisplayManager::UpdateDisplays(
std::sort(new_display_info_list.begin(),
new_display_info_list.end(),
DisplayInfoSortFunctor());
+
+ CreateSoftwareMirroringDisplayInfo(&new_display_info_list);
+
// Close the mirroring window if any here to avoid creating two compositor on
// one display.
if (delegate_)
- delegate_->CloseMirroringDisplay();
-
- CreateSoftwareMirroringDisplay(&new_display_info_list);
+ delegate_->CloseMirroringDisplayIfNotNecessary();
DisplayList new_displays;
DisplayList removed_displays;
@@ -1083,7 +1084,7 @@ void DisplayManager::UpdateInternalDisplayModeListForTest() {
SetInternalDisplayModeList(info);
}
-void DisplayManager::CreateSoftwareMirroringDisplay(
+void DisplayManager::CreateSoftwareMirroringDisplayInfo(
DisplayInfoList* display_info_list) {
// Use the internal display or 1st as the mirror source, then scale
// the root window so that it matches the external display's
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/mirror_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698