diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 03:49:06 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 03:49:06 +0000 |
commit | dc88374272661ce0b28997e8fda6bfae83a08ff6 (patch) | |
tree | ae82d306f1ba2f17251b9bafa63ed2252bb92875 /views | |
parent | f50ed900bb1860a1d1108103c7437801c62bcaaf (diff) | |
download | chromium_src-dc88374272661ce0b28997e8fda6bfae83a08ff6.zip chromium_src-dc88374272661ce0b28997e8fda6bfae83a08ff6.tar.gz chromium_src-dc88374272661ce0b28997e8fda6bfae83a08ff6.tar.bz2 |
Hack to fix incomplete redrawing of content area during window activation. Force a sync redraw of in-process child windows when a window is activated.
http://crbug.com/74604
TEST=see bug
TBR=sky
Review URL: http://codereview.chromium.org/6893085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/window/window_win.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/views/window/window_win.cc b/views/window/window_win.cc index a1f0218..8814e75 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -549,6 +549,17 @@ LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { return 0; } +namespace { +BOOL CALLBACK EnumChildWindowsForRedraw(HWND hwnd, LPARAM lparam) { + DWORD process_id; + GetWindowThreadProcessId(hwnd, &process_id); + int flags = RDW_INVALIDATE | RDW_NOCHILDREN | RDW_FRAME; + if (process_id == GetCurrentProcessId()) + flags |= RDW_UPDATENOW; + RedrawWindow(hwnd, NULL, NULL, flags); + return TRUE; +} +} // namespace LRESULT WindowWin::OnNCActivate(BOOL active) { if (!delegate_->CanActivate()) @@ -563,6 +574,17 @@ LRESULT WindowWin::OnNCActivate(BOOL active) { if (IsVisible()) GetWindow()->non_client_view()->SchedulePaint(); + if (!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(); |