diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 14:58:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 14:58:00 +0000 |
commit | ce4e55c1b59c774ec1ae337c79676087bdc52bda (patch) | |
tree | 986d3025f9f737b13fb602d1f805d0b89da92d52 /views/widget | |
parent | 50ce03d67bb64724d3ebc2b4a7d7a99b2ebe2e24 (diff) | |
download | chromium_src-ce4e55c1b59c774ec1ae337c79676087bdc52bda.zip chromium_src-ce4e55c1b59c774ec1ae337c79676087bdc52bda.tar.gz chromium_src-ce4e55c1b59c774ec1ae337c79676087bdc52bda.tar.bz2 |
Fix bug with drop arrow updating on the tabstrip. See comment in widget_win.cc
http://crbug.com/74764
TEST=none
Review URL: http://codereview.chromium.org/6665050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget_win.cc | 16 | ||||
-rw-r--r-- | views/widget/widget_win.h | 3 |
2 files changed, 16 insertions, 3 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index d39f767..2c247fd 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -136,6 +136,7 @@ WidgetWin::WidgetWin() active_mouse_tracking_flags_(0), use_layered_buffer_(false), layered_alpha_(255), + ALLOW_THIS_IN_INITIALIZER_LIST(paint_layered_window_factory_(this)), delete_on_destroy_(true), can_update_layered_window_(true), last_mouse_event_was_move_(false), @@ -397,6 +398,17 @@ void WidgetWin::SchedulePaintInRect(const gfx::Rect& rect) { // We must update the back-buffer immediately, since Windows' handling of // invalid rects is somewhat mysterious. layered_window_invalid_rect_ = layered_window_invalid_rect_.Union(rect); + + // In some situations, such as drag and drop, when Windows itself runs a + // nested message loop our message loop appears to be starved and we don't + // receive calls to DidProcessMessage(). This only seems to affect layered + // windows, so we schedule a redraw manually using a task, since those never + // seem to be starved. Also, wtf. + if (paint_layered_window_factory_.empty()) { + MessageLoop::current()->PostTask(FROM_HERE, + paint_layered_window_factory_.NewRunnableMethod( + &WidgetWin::RedrawLayeredWindowContents)); + } } else { // InvalidateRect() expects client coordinates. RECT r = rect.ToRECT(); @@ -1081,9 +1093,7 @@ void WidgetWin::MakeMSG(MSG* msg, UINT message, WPARAM w_param, LPARAM l_param, } void WidgetWin::RedrawInvalidRect() { - if (use_layered_buffer_) { - RedrawLayeredWindowContents(); - } else { + if (!use_layered_buffer_) { RECT r = { 0, 0, 0, 0 }; if (GetUpdateRect(hwnd(), &r, FALSE) && !IsRectEmpty(&r)) { RedrawWindow(hwnd(), &r, NULL, diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index 47863c7..2428a3e8 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -490,6 +490,9 @@ class WidgetWin : public ui::WindowImpl, // (In fact, it'll return misleading information from GetUpdateRect()). gfx::Rect layered_window_invalid_rect_; + // A factory that allows us to schedule a redraw for layered windows. + ScopedRunnableMethodFactory<WidgetWin> paint_layered_window_factory_; + // Whether or not the window should delete itself when it is destroyed. // Set this to false via its setter for stack allocated instances. bool delete_on_destroy_; |