summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 21:30:42 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 21:30:42 +0000
commitcba5e2bee85930e6e6e8730d8a6fb4d98b09f4de (patch)
treea2f7b25f2ac7e8f6e96fbbeca7439c382e38a81f /ash
parentaed3703d1355f2c70ea5521d23faf96f65f58534 (diff)
downloadchromium_src-cba5e2bee85930e6e6e8730d8a6fb4d98b09f4de.zip
chromium_src-cba5e2bee85930e6e6e8730d8a6fb4d98b09f4de.tar.gz
chromium_src-cba5e2bee85930e6e6e8730d8a6fb4d98b09f4de.tar.bz2
ash: Do a null-check for the screen-position client.
In a multi-monitor setup, when switching from extended mode to mirror mode, it is possible for the external monitor to receive events between when its RootWindowController is Shutdown()ed (which destroyes the screen-position client) and the root-window is destroyed. So make sure the client is there before trying to use it to convert the event's location to screen space. BUG=358266 R=oshima@chromium.org Review URL: https://codereview.chromium.org/286913009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/coordinate_conversion.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/ash/wm/coordinate_conversion.cc b/ash/wm/coordinate_conversion.cc
index dde314f..e32ddcd 100644
--- a/ash/wm/coordinate_conversion.cc
+++ b/ash/wm/coordinate_conversion.cc
@@ -32,9 +32,10 @@ aura::Window* GetRootWindowMatching(const gfx::Rect& rect) {
}
void ConvertPointToScreen(const aura::Window* window, gfx::Point* point) {
- CHECK(window);
- CHECK(window->GetRootWindow());
- CHECK(aura::client::GetScreenPositionClient(window->GetRootWindow()));
+ // It is possible for the root window to not have a screen position client
+ // when switching multi-monitor mode from extended to mirror.
+ if (!aura::client::GetScreenPositionClient(window->GetRootWindow()))
+ return;
aura::client::GetScreenPositionClient(window->GetRootWindow())->
ConvertPointToScreen(window, point);
}