Commit cba5e2be authored by sadrul@chromium.org's avatar sadrul@chromium.org

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
parent aed3703d
...@@ -32,9 +32,10 @@ aura::Window* GetRootWindowMatching(const gfx::Rect& rect) { ...@@ -32,9 +32,10 @@ aura::Window* GetRootWindowMatching(const gfx::Rect& rect) {
} }
void ConvertPointToScreen(const aura::Window* window, gfx::Point* point) { void ConvertPointToScreen(const aura::Window* window, gfx::Point* point) {
CHECK(window); // It is possible for the root window to not have a screen position client
CHECK(window->GetRootWindow()); // when switching multi-monitor mode from extended to mirror.
CHECK(aura::client::GetScreenPositionClient(window->GetRootWindow())); if (!aura::client::GetScreenPositionClient(window->GetRootWindow()))
return;
aura::client::GetScreenPositionClient(window->GetRootWindow())-> aura::client::GetScreenPositionClient(window->GetRootWindow())->
ConvertPointToScreen(window, point); ConvertPointToScreen(window, point);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment