diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 00:29:41 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 00:29:41 +0000 |
commit | 8f87bd7b1a3a8dc2b22d402bbccdd81920464ac3 (patch) | |
tree | b9e80c3c84443de75fff65604e1c24d68c5f6159 /views/widget | |
parent | dcefa305312e7045cce1ec6bc746a4ba26dec871 (diff) | |
download | chromium_src-8f87bd7b1a3a8dc2b22d402bbccdd81920464ac3.zip chromium_src-8f87bd7b1a3a8dc2b22d402bbccdd81920464ac3.tar.gz chromium_src-8f87bd7b1a3a8dc2b22d402bbccdd81920464ac3.tar.bz2 |
Fix painting problems that came up after manually calling RedrawWindow on child windows so that we can paint out of process HWNDs asynchronously. The problem is that the function parameter that was passed in to the first RedrawWindow was modified since it's a member variable of the class. OnPaint would empty the rectangle, and so nothing was painted for children.
BUG=12010
TEST=unsafe downloads should have their save/discard buttons painted normally.
Review URL: http://codereview.chromium.org/115545
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget_win.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 56702e7..4fa77a8 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -290,16 +290,19 @@ void WidgetWin::PaintNow(const gfx::Rect& update_rect) { } else { // Paint child windows that are in a different process asynchronously. // This prevents a hang in other processes from blocking this process. - ::RedrawWindow(hwnd_, &update_rect.ToRECT(), NULL, - RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); - // Send the invalid rect in screen coordinates. + // Calculate the invalid rect in screen coordinates before the first + // RedrawWindow call to the parent HWND, since that will empty update_rect + // (which comes from a member variable) in the OnPaint call. CRect screen_rect_temp; GetWindowRect(&screen_rect_temp); gfx::Rect screen_rect(screen_rect_temp); gfx::Rect invalid_screen_rect = update_rect; invalid_screen_rect.Offset(screen_rect.x(), screen_rect.y()); + ::RedrawWindow(hwnd_, &update_rect.ToRECT(), NULL, + RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); + LPARAM lparam = reinterpret_cast<LPARAM>(&invalid_screen_rect); EnumChildWindows(hwnd_, EnumChildProcForRedraw, lparam); } |