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

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: cleanup 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
Index: ash/monitor/multi_monitor_manager.cc
diff --git a/ash/monitor/multi_monitor_manager.cc b/ash/monitor/multi_monitor_manager.cc
index 8ed2de9be05718c1ce4593dacf59e7ff2db0cbf6..36242af35ee20106125abfdd925bb9e90de7acb2 100644
--- a/ash/monitor/multi_monitor_manager.cc
+++ b/ash/monitor/multi_monitor_manager.cc
@@ -90,8 +90,10 @@ 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);

Powered by Google App Engine
This is Rietveld 408576698