diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 20:29:43 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 20:29:43 +0000 |
commit | 8705f4b23d41fe68424c6804813bd947b3293c3f (patch) | |
tree | 6db1f142086d448e8bb3c12e414f83be56185d84 /ui | |
parent | 61102d099fc2938b6c45406aa2894149f90739c4 (diff) | |
download | chromium_src-8705f4b23d41fe68424c6804813bd947b3293c3f.zip chromium_src-8705f4b23d41fe68424c6804813bd947b3293c3f.tar.gz chromium_src-8705f4b23d41fe68424c6804813bd947b3293c3f.tar.bz2 |
linux_aura: Temporarily restore IsChildOfRootWindow() checks on Linux.
This was causing the main frame to Blur(). Use #ifdefs for OS_WIN.
BUG=158118
Review URL: https://chromiumcodereview.appspot.com/11314015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/desktop/desktop_activation_client.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ui/aura/desktop/desktop_activation_client.cc b/ui/aura/desktop/desktop_activation_client.cc index 4699a50..345f753 100644 --- a/ui/aura/desktop/desktop_activation_client.cc +++ b/ui/aura/desktop/desktop_activation_client.cc @@ -12,17 +12,6 @@ #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(FocusManager* focus_manager) @@ -119,10 +108,21 @@ void DesktopActivationClient::OnWindowFocused(aura::Window* window) { } bool DesktopActivationClient::CanActivateWindow(aura::Window* window) const { - return window && + bool can_activate = window && window->IsVisible() && (!aura::client::GetActivationDelegate(window) || - aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)); + aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)); + +#if defined(OS_LINUX) + if (can_activate) { + // TODO(erg,ananta): Windows behaves differently than Linux; clicking will + // always send an activation message on windows while on Linux we'll need + // to emulate that behavior if views is expecting it. + can_activate = window->parent() == window->GetRootWindow(); + } +#endif + + return can_activate; } aura::Window* DesktopActivationClient::GetActivatableWindow( |