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

Unified Diff: ash/root_window_controller.cc

Issue 10909043: Cancel drag if display configuration changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix, adjust test screen size Created 8 years, 3 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/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 8155f35f7276e56ce4378185d49fdc8004948972..15386beb5356465d1d368cf6fb330240cfc0c093 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -8,6 +8,7 @@
#include "ash/desktop_background/desktop_background_widget_controller.h"
#include "ash/display/display_controller.h"
+#include "ash/display/multi_display_manager.h"
#include "ash/shell.h"
#include "ash/shell_factory.h"
#include "ash/shell_window_ids.h"
@@ -293,6 +294,12 @@ RootWindowController::RootWindowController(aura::RootWindow* root_window)
}
RootWindowController::~RootWindowController() {
+ Shutdown();
+ root_window_.reset();
+}
+
+void RootWindowController::Shutdown() {
+ CloseChildWindows();
if (Shell::GetActiveRootWindow() == root_window_.get()) {
Shell::GetInstance()->set_active_root_window(
Shell::GetPrimaryRootWindow() == root_window_.get() ?
@@ -302,7 +309,11 @@ RootWindowController::~RootWindowController() {
event_client_.reset();
screen_dimmer_.reset();
workspace_controller_.reset();
- root_window_.reset();
+ // Forget with the display ID so that display lookup
+ // ends up with invalid display.
+ root_window_->ClearProperty(kDisplayIdKey);
+ // And this root window should no longer process events.
+ root_window_->StopListeningEvents();
}
aura::Window* RootWindowController::GetContainer(int container_id) {

Powered by Google App Engine
This is Rietveld 408576698