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

Unified Diff: ash/display/display_manager.cc

Issue 1019093002: Update mirroring display even if the display configurations that are visible to ash/chrome hasn't c… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 9 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_manager_unittest.cc » ('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 c407da47751977e3c47a3f80052cf4edbe76b058..7d8967f0f7915e8ee2d5144f91870ac7d87fea56 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -810,14 +810,21 @@ void DisplayManager::UpdateDisplays(
// http://crbug.com/155948.
if (display_changes.empty() && added_display_indices.empty() &&
removed_displays.empty()) {
- // When changing from software mirroring mode to sinlge display mode, it
- // is possible there is no need to update |displays_| and we early out
- // here. But we still want to run the PostDisplayConfigurationChange()
- // cause there are some clients need to act on this, e.g.
- // TouchTransformerController needs to adjust the TouchTransformer when
- // switching from dual displays to single display.
- if (delegate_)
+ // When changing from software mirroring mode to sinlge display
+ // mode, it is possible there is no need to update |displays_| and
+ // we early out here. But we still need to update the mirroring
+ // window and call the PostDisplayConfigurationChange() cause
+ // there are some clients need to act on this,
+ // e.g. TouchTransformerController needs to adjust the
+ // TouchTransformer when/ switching from dual displays to single
+ // display.
+ if (delegate_) {
+ if (HasSoftwareMirroringDisplay())
+ CreateMirrorWindowAsyncIfAny();
+ else
+ delegate_->CloseMirroringDisplay();
delegate_->PostDisplayConfigurationChange();
+ }
return;
}
@@ -911,8 +918,7 @@ void DisplayManager::UpdateDisplays(
// Create the mirroring window asynchronously after all displays
// are added so that it can mirror the display newly added. This can
// happen when switching from dock mode to software mirror mode.
- if (has_mirroring_display && delegate_)
- CreateMirrorWindowAsyncIfAny();
+ CreateMirrorWindowAsyncIfAny();
}
const gfx::Display& DisplayManager::GetDisplayAt(size_t index) const {
@@ -1062,6 +1068,9 @@ bool DisplayManager::UpdateDisplayBounds(int64 display_id,
}
void DisplayManager::CreateMirrorWindowAsyncIfAny() {
+ // Do not post a task if the software mirroring doesn't exist.
+ if (!HasSoftwareMirroringDisplay() || !delegate_)
+ return;
base::MessageLoopForUI::current()->PostTask(
FROM_HERE,
base::Bind(&DisplayManager::CreateMirrorWindowIfAny,
« no previous file with comments | « no previous file | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698