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

Unified Diff: ash/display/mirror_window_controller.cc

Issue 2932563002: Implement cursor changing on Mushrome (Closed)
Patch Set: oshima patch take 2 Created 3 years, 6 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/BUILD.gn ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mirror_window_controller.cc
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index 914eb829b1d1d3b0882fa7a31b3af995a0a6f316..d0f3267722c42d34d9c6d9a261c945df9ea323b1 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -272,18 +272,31 @@ void MirrorWindowController::UpdateWindow() {
if (mirroring_host_info_map_.empty())
return;
display::DisplayManager* display_manager = Shell::Get()->display_manager();
+ display::Screen* screen = display::Screen::GetScreen();
+
std::vector<display::ManagedDisplayInfo> display_info_list;
- for (auto& pair : mirroring_host_info_map_)
- display_info_list.push_back(display_manager->GetDisplayInfo(pair.first));
+ // Prune the window on the removed displays.
+ for (auto& pair : mirroring_host_info_map_) {
+ MirroringHostInfo* info = pair.second;
+ if (screen
+ ->GetDisplayNearestWindow(
+ info->ash_host->AsWindowTreeHost()->window())
+ .is_valid()) {
+ display_info_list.push_back(display_manager->GetDisplayInfo(pair.first));
+ }
+ }
UpdateWindow(display_info_list);
}
void MirrorWindowController::CloseIfNotNecessary() {
display::DisplayManager::MultiDisplayMode new_mode =
GetCurrentMultiDisplayMode();
- if (multi_display_mode_ != new_mode)
+ if (multi_display_mode_ != new_mode) {
Close(true);
- multi_display_mode_ = new_mode;
+ multi_display_mode_ = new_mode;
+ } else {
+ UpdateWindow();
+ }
}
void MirrorWindowController::Close(bool delay_host_deletion) {
« no previous file with comments | « ash/BUILD.gn ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698