Commit 6a3ad06b authored by ananta@chromium.org's avatar ananta@chromium.org

Ensure that a fullscreen RenderWidgetHostViewAura instance does not restore...

Ensure that a fullscreen RenderWidgetHostViewAura instance does not restore itself on Windows when we switch away to a different
monitor.

We have code in RenderWidgetHostViewAura::OnWindowFocused to handle this case. It does this by comparing the display ids of
the window being activated and the one losing activation. However in desktop Chrome we could lose activation to a non Aura Window.

We handle this case on Windows by getting the cursor position and the display near that and comparing that with the display of the
window losing activation.

Fixes bug https://code.google.com/p/chromium/issues/detail?id=317532

BUG=317532
R=jam@chromium.org, jam

Review URL: https://codereview.chromium.org/100683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238441 0039d316-1c4b-4281-b951-d872f2087c98
parent eeb85af7
...@@ -2979,6 +2979,17 @@ void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, ...@@ -2979,6 +2979,17 @@ void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
(screen->GetDisplayNearestWindow(window_).id() != (screen->GetDisplayNearestWindow(window_).id() !=
screen->GetDisplayNearestWindow(gained_focus).id()); screen->GetDisplayNearestWindow(gained_focus).id());
if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) {
#if defined(OS_WIN)
// On Windows, if we are switching to a non Aura Window on a different
// screen we should not close the fullscreen window.
if (!gained_focus) {
POINT point = {0};
::GetCursorPos(&point);
if (screen->GetDisplayNearestWindow(window_).id() !=
screen->GetDisplayNearestPoint(gfx::Point(point)).id())
return;
}
#endif
in_shutdown_ = true; in_shutdown_ = true;
host_->Shutdown(); host_->Shutdown();
} }
......
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