Chromium Code Reviews
DescriptionIn Windows desktop Chrome AURA the HandleVisibilityChanged function on the HWNDMessageHandlerDelegate
is invoked too late.
We invoke the HandleVisibilityChanged function on the delegate in the WM_WINDOWPOSCHANGED
message when the window has become visible.
This breaks the inactive frame rendering in Chrome AURA when a bubble is opened which causes
the browser window to be painted as deactivated. Reason being the WM_NCACTIVATE message
which paints the caption is sent to the browser before the WM_WINDOWPOSCHANGED with SWP_SHOWWINDOW
is sent to the bubble. This works in non AURA chrome on Windows because the avatar bubble calls ShowWindow
with SW_SHOWNOACTIVATE. Explanation below:-
In non AURA chrome there are two widgets created when the bubble is displayed
1. A widget with type TYPE_WINDOW_FRAMELESS
2. The border widget with type TYPE_BUBBLE
The widget which is displayed is the first one, which does not have a non client view thus resulting Widget::Show
calling the native_widgets Show() function which calls the ShowWindow API with SW_SHOWNOACTIVATE.
In AURA chrome there is only one widget created with type TYPE_BUBBLE which has a non client view. The Widget::Show
function invokes the ShowWithWindowState function which eventually calls ShowWindow with SW_SHOWNORMAL which results
in the main window losing activation.
It looks like the inactive frame rendering hack works correctly on non AURA chrome by fluke.
The fix I am proposing for AURA chrome is to add a virtual function AlwaysPaintActivated to the DesktopRootWindowHost class.
This would be invoked from the DesktopNativeWidgetAura::SetInactiveRenderingDisabled function which sets the inactive
rendering flag on the window. The windows implementation of the AlwaysPaintActivated function in the DesktopRootWindowHostWin
class calls DefWindowProc with wParam as 1 or 0 depending on whether the inactive frame is to be rendered as active or not.
Another approach could be to always call ShowWindow with SW_SHOWNOACTIVATE for popups. I don't know whether there is a
need for popups to be OS activated.
BUG=229599
R=ben
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=196192
Patch Set 1 #Patch Set 2 : #
Total comments: 2
Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #
Total comments: 5
Patch Set 6 : #
Total comments: 2
Patch Set 7 : #
Messages
Total messages: 13 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||