diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 21:26:14 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 21:26:14 +0000 |
commit | 9bfcb6f4cf4f12f601b81fab7ba7b8ea2ccd2ac9 (patch) | |
tree | d0afb7b7521057668056a176abe02eddc7fb9513 /ui/views/win | |
parent | 1a1405c9a79558a9f0b8087be7ee3b704b306a27 (diff) | |
download | chromium_src-9bfcb6f4cf4f12f601b81fab7ba7b8ea2ccd2ac9.zip chromium_src-9bfcb6f4cf4f12f601b81fab7ba7b8ea2ccd2ac9.tar.gz chromium_src-9bfcb6f4cf4f12f601b81fab7ba7b8ea2ccd2ac9.tar.bz2 |
Perform the window activation code in WM_ACTIVATE instead of WM_NCACTIVATE.
This ensures that we don't inadvarently mark a window as active when the code uses APIs like FlashWindow,
which send periodic WM_NCACTIVATE messages to flash the caption.
BUG=297813
TEST=Covered by ui test WidgetNotActivatedOnFakeActivationMessages
R=sky@chromium.org
Review URL: https://codereview.chromium.org/24856002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/win')
-rw-r--r-- | ui/views/win/hwnd_message_handler.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc index b2fac0a..c17589f 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -964,7 +964,12 @@ void HWNDMessageHandler::SetInitialFocus() { void HWNDMessageHandler::PostProcessActivateMessage(int activation_state, bool minimized) { DCHECK(delegate_->CanSaveFocus()); - if (WA_INACTIVE == activation_state || minimized) { + + bool active = activation_state != WA_INACTIVE && !minimized; + if (delegate_->CanActivate()) + delegate_->HandleActivationChanged(active); + + if (!active) { // We might get activated/inactivated without being enabled, so we need to // clear restore_focus_when_enabled_. restore_focus_when_enabled_ = false; @@ -1630,9 +1635,6 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, bool inactive_rendering_disabled = delegate_->IsInactiveRenderingDisabled(); - if (delegate_->CanActivate()) - delegate_->HandleActivationChanged(!!active); - if (!delegate_->IsWidgetWindow()) { SetMsgHandled(FALSE); return 0; |