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

Unified Diff: ash/monitor/multi_monitor_manager.cc

Issue 9835068: Don't delete Primary root window and monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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 | « ash/monitor/monitor_controller.cc ('k') | ash/monitor/multi_monitor_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/monitor/multi_monitor_manager.cc
diff --git a/ash/monitor/multi_monitor_manager.cc b/ash/monitor/multi_monitor_manager.cc
index 926aac119c4f9e2e43086d13e2643e1345b30bc2..01a9f0232c64926261d0c2ccfc217367acf591d0 100644
--- a/ash/monitor/multi_monitor_manager.cc
+++ b/ash/monitor/multi_monitor_manager.cc
@@ -90,11 +90,15 @@ void MultiMonitorManager::OnNativeMonitorsChanged(
NotifyMonitorAdded(monitor);
}
} else {
- // Monitors are removed.
- while (monitors_.size() > new_monitors.size()) {
+ // Monitors are removed. We keep the monitor for the primary
+ // monitor (at index 0) because it needs the monitor information
+ // even if it doesn't exit.
+ while (monitors_.size() > new_monitors.size() && monitors_.size() > 1) {
Monitor* monitor = monitors_.back();
// Monitor object is deleted in OnWindowDestroying.
NotifyMonitorRemoved(monitor);
+ DCHECK(find(monitors_.begin(), monitors_.end(), monitor) ==
+ monitors_.end());
}
}
}
« no previous file with comments | « ash/monitor/monitor_controller.cc ('k') | ash/monitor/multi_monitor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698