DescriptionUse WindowActivated message instead of VisibilityChanged message to determine that Ash is the active desktop on Win8.
This is better than the VisibilityChanged event as it also handles the dual monitor case where Ash isn't hidden yet is no longer active (and Chrome desktop window can thus steal the "active desktop" state which was then not given back to the Ash desktop when re-focusing it. The WindowActivated event gets a CoreWindowActivationState_PointerActivated state for this specific case; which we treat the same as CoreWindowActivationState_CodeActivated for now.
Also remove the hooks for VisibilityChanged as they were only used for this purpose, i.e.:
https://code.google.com/p/chromium/codesearch#search/&q=OnRootWindowActivated&sq=package:chromium&type=cs
Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/env.cc&l=83
Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/root_window.cc&l=988
Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/remote_root_window_host_win.cc&l=463
BUG=177489
TEST=
The most reliable test I could find that would repro this is to:
1) Open Ash
2) Open Chrome on desktop on a 2nd monitor
3) Refocus Ash on first monitor
4) Signin with an account which will sync extensions (at least one of which opens a tab on install, e.g., https://chrome.google.com/webstore/detail/reload-all-tabs/midkcinmplflbiflboepnahkboeonkam).
Without this CL, this will result in the extension's tab opening on the desktop Chrome's window.
With this CL, the tab correctly opens in Ash as it was the last desktop focused.
Also make sure the regular use cases still work using the same test under:
A) Only Ash open
B) Ash open, but active desktop is native desktop.
Also confirmed using Sawbuck and some logging that the following is how OnWindowActivated() reports its state:
CoreWindowActivationState_CodeActivated == 0
- First activation
- Activated when hidden (either from Start Screen or Windows app switcher while viewing another app).
CoreWindowActivationState_Deactivated == 1
- All deactivations (including focusing a desktop app on the 2nd monitor while Ash remains open on 1st monitor)
CoreWindowActivationState_PointerActivated
- Ash is focused again after a window on another monitor had been focused while Ash stayed visible on its monitor.
R=cdn@chromium.org, grt@chromium.org, sky@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229420
Patch Set 1 #
Total comments: 1
Patch Set 2 : s/screen/monitor #
Total comments: 4
Patch Set 3 : +comment #
Total comments: 4
Patch Set 4 : remove dead code #Patch Set 5 : merge up to r229418 #
Messages
Total messages: 27 (0 generated)
|