Index: ui/aura/root_window.cc |
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
index 88e9f8998837919e6639aa05a876a5827e510c50..6689df26a864ddce6067592846643d24a7b0ca77 100644 |
--- a/ui/aura/root_window.cc |
+++ b/ui/aura/root_window.cc |
@@ -130,6 +130,7 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds) |
draw_on_compositing_end_(false), |
defer_draw_scheduling_(false), |
mouse_move_hold_count_(0), |
+ ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)), |
compositor_lock_(NULL), |
draw_on_compositor_unlock_(false) { |
SetName("RootWindow"); |
@@ -485,14 +486,20 @@ void RootWindow::ToggleFullScreen() { |
#endif |
void RootWindow::HoldMouseMoves() { |
+ if (!mouse_move_hold_count_) |
+ held_mouse_event_factory_.InvalidateWeakPtrs(); |
jonathan.backer
2012/06/12 17:32:38
Why are we invalidating? It happens all the time w
|
++mouse_move_hold_count_; |
} |
void RootWindow::ReleaseMouseMoves() { |
--mouse_move_hold_count_; |
DCHECK_GE(mouse_move_hold_count_, 0); |
- if (!mouse_move_hold_count_) |
- DispatchHeldMouseMove(); |
+ if (!mouse_move_hold_count_ && held_mouse_move_.get()) { |
+ MessageLoop::current()->PostTask( |
sky
2012/06/12 03:57:47
Add a comment as to why we don't process immediate
piman
2012/06/12 19:49:49
Done.
|
+ FROM_HERE, |
+ base::Bind(&RootWindow::DispatchHeldMouseMove, |
+ held_mouse_event_factory_.GetWeakPtr())); |
+ } |
} |
scoped_refptr<CompositorLock> RootWindow::GetCompositorLock() { |