diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-14 22:02:54 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-14 22:02:54 +0000 |
commit | 214d6def76b6229653fc9863548a477e3f2c1a48 (patch) | |
tree | 36135390539929c1094da13bcff904e3c2054bc2 /views/widget | |
parent | 62791ba291875f33c05a5afb5e83d956700f25df (diff) | |
download | chromium_src-214d6def76b6229653fc9863548a477e3f2c1a48.zip chromium_src-214d6def76b6229653fc9863548a477e3f2c1a48.tar.gz chromium_src-214d6def76b6229653fc9863548a477e3f2c1a48.tar.bz2 |
Make sure custom frame windows paint as active when they're activated.
Rationale for fix:
The code in NativeWidgetWin::OnNCActivate schedules a paint for the entire non-client view if the window is visible because its activation state has changed and it'll doubtless require a repaint.
A subsequent hack introduced by me to recover from the "other windows bleed through the UI" immediately forces a redraw, before the default WM_NCACTIVATE handler is called for the window.
It seems that the window's active state is only set by or after the default WM_NCACTIVATE handler, so this hack redraw causes the window to just repaint itself as inactive since the state hasn't updated yet (and my earlier refactorings have made the frame ask Windows if the window is active rather than relying on custom cached state).
So, to address this I moved the hack redraw from NativeWidgetWin::OnNCActivate to NativeWidgetWin::OnActivate, after the state and redraws should have happened. This corrects the issue for me.
http://crbug.com/85791
TEST=see bug
Review URL: http://codereview.chromium.org/7165003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/native_widget_win.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc index dce389b..efde6a9 100644 --- a/views/widget/native_widget_win.cc +++ b/views/widget/native_widget_win.cc @@ -1117,6 +1117,17 @@ LRESULT NativeWidgetWin::OnWndProc(UINT message, WPARAM w_param, // Message handlers ------------------------------------------------------------ void NativeWidgetWin::OnActivate(UINT action, BOOL minimized, HWND window) { + if (!GetWidget()->ShouldUseNativeFrame()) { + // TODO(beng, et al): Hack to redraw this window and child windows + // synchronously upon activation. Not all child windows are redrawing + // themselves leading to issues like http://crbug.com/74604 + // We redraw out-of-process HWNDs asynchronously to avoid hanging the + // whole app if a child HWND belonging to a hung plugin is encountered. + RedrawWindow(GetNativeView(), NULL, NULL, + RDW_NOCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW); + EnumChildWindows(GetNativeView(), EnumChildWindowsForRedraw, NULL); + } + SetMsgHandled(FALSE); } @@ -1569,17 +1580,6 @@ LRESULT NativeWidgetWin::OnNCActivate(BOOL active) { if (IsVisible()) GetWidget()->non_client_view()->SchedulePaint(); - if (!GetWidget()->ShouldUseNativeFrame()) { - // TODO(beng, et al): Hack to redraw this window and child windows - // synchronously upon activation. Not all child windows are redrawing - // themselves leading to issues like http://crbug.com/74604 - // We redraw out-of-process HWNDs asynchronously to avoid hanging the - // whole app if a child HWND belonging to a hung plugin is encountered. - RedrawWindow(GetNativeView(), NULL, NULL, - RDW_NOCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW); - EnumChildWindows(GetNativeView(), EnumChildWindowsForRedraw, NULL); - } - // If we're active again, we should be allowed to render as inactive, so // tell the non-client view. bool inactive_rendering_disabled = delegate_->IsInactiveRenderingDisabled(); |