diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 22:24:25 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 22:24:25 +0000 |
commit | 29ae832f0be06cfd5b26d1b92804458a52fa6cd6 (patch) | |
tree | 75f83bd35a58b37f8bba2c2fdfabc43503b7ef3e /ui/aura | |
parent | dc0452a27b59920c9c9430b78bbac27b0b86246d (diff) | |
download | chromium_src-29ae832f0be06cfd5b26d1b92804458a52fa6cd6.zip chromium_src-29ae832f0be06cfd5b26d1b92804458a52fa6cd6.tar.gz chromium_src-29ae832f0be06cfd5b26d1b92804458a52fa6cd6.tar.bz2 |
linux_aura: Focus BrowserFrameAura instead of RenderWidgetHostViewAura.
This is the simple activation patch. It fixes the immediate problem
where key events never reach the RWHVA. This happened because we
didn't walk the window heirarchy up to the BrowserFrameAura, stopping
at the WebContentsViewAura.
Follow up patches will be needed because this breaks lots of
assumptions we make in handling activation across multiple windows;
after navigating or opening a menu, the main browser window never
deactivates when switching to a different application. However, that
will take a while and in the interim, it would be nice to be able to
use the keyboard with a linux_aura build.
BUG=133089
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10577042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/desktop/desktop_activation_client.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/aura/desktop/desktop_activation_client.cc b/ui/aura/desktop/desktop_activation_client.cc index 714b27b..7b2e08e 100644 --- a/ui/aura/desktop/desktop_activation_client.cc +++ b/ui/aura/desktop/desktop_activation_client.cc @@ -11,6 +11,17 @@ #include "ui/aura/root_window.h" #include "ui/aura/window.h" +namespace { + +// Checks to make sure this window is a direct child of the Root Window. We do +// this to mirror ash's more interesting behaviour: it checks to make sure the +// window it's going to activate is a child of one a few container windows. +bool IsChildOfRootWindow(aura::Window* window) { + return window && window->parent() == window->GetRootWindow(); +} + +} // namespace + namespace aura { DesktopActivationClient::DesktopActivationClient(RootWindow* root_window) @@ -86,7 +97,7 @@ Window* DesktopActivationClient::GetActiveWindow() { bool DesktopActivationClient::OnWillFocusWindow(Window* window, const Event* event) { - return CanActivateWindow(window); + return CanActivateWindow(GetActivatableWindow(window)); } void DesktopActivationClient::OnWindowFocused(aura::Window* window) { @@ -97,7 +108,8 @@ bool DesktopActivationClient::CanActivateWindow(aura::Window* window) const { return window && window->IsVisible() && (!aura::client::GetActivationDelegate(window) || - aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)); + aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && + IsChildOfRootWindow(window); } aura::Window* DesktopActivationClient::GetActivatableWindow( |