Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Issue 14299009: In Windows desktop Chrome AURA the HandleVisibilityChanged function on the HWNDMessageHandlerDelega… (Closed)

Created:
7 years, 8 months ago by ananta
Modified:
7 years, 8 months ago
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

In 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 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -0 lines) Patch
M ui/views/widget/desktop_aura/desktop_native_widget_aura.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.cc View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
ananta
7 years, 8 months ago (2013-04-16 22:39:28 UTC) #1
Ben Goodger (Google)
https://codereview.chromium.org/14299009/diff/12001/ui/views/win/hwnd_message_handler.h File ui/views/win/hwnd_message_handler.h (right): https://codereview.chromium.org/14299009/diff/12001/ui/views/win/hwnd_message_handler.h#newcode297 ui/views/win/hwnd_message_handler.h:297: MSG_WM_SHOWWINDOW(OnShowWindow) is this message sent under every situation that ...
7 years, 8 months ago (2013-04-17 18:22:11 UTC) #2
ananta
https://codereview.chromium.org/14299009/diff/12001/ui/views/win/hwnd_message_handler.h File ui/views/win/hwnd_message_handler.h (right): https://codereview.chromium.org/14299009/diff/12001/ui/views/win/hwnd_message_handler.h#newcode297 ui/views/win/hwnd_message_handler.h:297: MSG_WM_SHOWWINDOW(OnShowWindow) On 2013/04/17 18:22:12, Ben Goodger (Google) wrote: > ...
7 years, 8 months ago (2013-04-18 19:15:30 UTC) #3
Ben Goodger (Google)
https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc File ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (right): https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc#newcode385 ui/views/widget/desktop_aura/desktop_root_window_host_win.cc:385: ::DefWindowProc(message_handler_->hwnd(), WM_NCACTIVATE, !!value, 0); Seems like this could have ...
7 years, 8 months ago (2013-04-19 16:17:03 UTC) #4
ananta
https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc File ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (right): https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc#newcode385 ui/views/widget/desktop_aura/desktop_root_window_host_win.cc:385: ::DefWindowProc(message_handler_->hwnd(), WM_NCACTIVATE, !!value, 0); On 2013/04/19 16:17:03, Ben Goodger ...
7 years, 8 months ago (2013-04-19 18:21:26 UTC) #5
ananta
Adding sky
7 years, 8 months ago (2013-04-23 00:19:35 UTC) #6
sky
https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc File ui/views/widget/desktop_aura/desktop_native_widget_aura.cc (right): https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc#newcode547 ui/views/widget/desktop_aura/desktop_native_widget_aura.cc:547: desktop_root_window_host_->AlwaysPaintActivated(value); Can you make this match the already existing ...
7 years, 8 months ago (2013-04-23 14:15:54 UTC) #7
ananta
On 2013/04/23 14:15:54, sky wrote: > https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc > File ui/views/widget/desktop_aura/desktop_native_widget_aura.cc (right): > > https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc#newcode547 > ...
7 years, 8 months ago (2013-04-23 18:09:59 UTC) #8
ananta
https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc File ui/views/widget/desktop_aura/desktop_native_widget_aura.cc (right): https://codereview.chromium.org/14299009/diff/20009/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc#newcode547 ui/views/widget/desktop_aura/desktop_native_widget_aura.cc:547: desktop_root_window_host_->AlwaysPaintActivated(value); On 2013/04/23 14:15:54, sky wrote: > Can you ...
7 years, 8 months ago (2013-04-23 18:10:06 UTC) #9
sky
https://codereview.chromium.org/14299009/diff/44001/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc File ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (right): https://codereview.chromium.org/14299009/diff/44001/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc#newcode388 ui/views/widget/desktop_aura/desktop_root_window_host_win.cc:388: ::DefWindowProc(message_handler_->hwnd(), Add a description as to why this is ...
7 years, 8 months ago (2013-04-23 21:25:59 UTC) #10
ananta
https://codereview.chromium.org/14299009/diff/44001/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc File ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (right): https://codereview.chromium.org/14299009/diff/44001/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc#newcode388 ui/views/widget/desktop_aura/desktop_root_window_host_win.cc:388: ::DefWindowProc(message_handler_->hwnd(), On 2013/04/23 21:25:59, sky wrote: > Add a ...
7 years, 8 months ago (2013-04-23 21:32:28 UTC) #11
sky
LGTM
7 years, 8 months ago (2013-04-23 22:35:33 UTC) #12
ananta
7 years, 8 months ago (2013-04-24 19:05:54 UTC) #13
Message was sent while issue was closed.
Committed patchset #7 manually as r196192 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698