Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 } | 769 } |
| 770 | 770 |
| 771 if (!dispatch_details.dispatcher_destroyed) | 771 if (!dispatch_details.dispatcher_destroyed) |
| 772 dispatching_held_event_ = false; | 772 dispatching_held_event_ = false; |
| 773 return dispatch_details; | 773 return dispatch_details; |
| 774 } | 774 } |
| 775 | 775 |
| 776 void RootWindow::PostMouseMoveEventAfterWindowChange() { | 776 void RootWindow::PostMouseMoveEventAfterWindowChange() { |
| 777 if (synthesize_mouse_move_) | 777 if (synthesize_mouse_move_) |
| 778 return; | 778 return; |
| 779 // Don't synthesize mouse move while holding mouse. | |
| 780 // We also clear the held move event since held event target location may | |
| 781 // be wrong now (see comments in DispatchHeldEvents). | |
| 782 if (move_hold_count_) { | |
| 783 if (held_move_event_ && !dispatching_held_event_) | |
| 784 held_move_event_.reset(); | |
| 785 return; | |
|
sky
2014/02/13 17:49:04
If you do this, don't we need to ensure when mouse
dgozman
2014/02/13 17:55:06
There is already a drop of held moves on the line
| |
| 786 } | |
| 779 synthesize_mouse_move_ = true; | 787 synthesize_mouse_move_ = true; |
| 780 base::MessageLoop::current()->PostNonNestableTask( | 788 base::MessageLoop::current()->PostNonNestableTask( |
| 781 FROM_HERE, | 789 FROM_HERE, |
| 782 base::Bind(base::IgnoreResult(&RootWindow::SynthesizeMouseMoveEvent), | 790 base::Bind(base::IgnoreResult(&RootWindow::SynthesizeMouseMoveEvent), |
| 783 held_event_factory_.GetWeakPtr())); | 791 held_event_factory_.GetWeakPtr())); |
| 784 } | 792 } |
| 785 | 793 |
| 786 ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() { | 794 ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() { |
| 787 DispatchDetails details; | 795 DispatchDetails details; |
| 788 if (!synthesize_mouse_move_) | 796 if (!synthesize_mouse_move_) |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 941 break; | 949 break; |
| 942 | 950 |
| 943 default: | 951 default: |
| 944 NOTREACHED(); | 952 NOTREACHED(); |
| 945 break; | 953 break; |
| 946 } | 954 } |
| 947 PreDispatchLocatedEvent(target, event); | 955 PreDispatchLocatedEvent(target, event); |
| 948 } | 956 } |
| 949 | 957 |
| 950 } // namespace aura | 958 } // namespace aura |
| OLD | NEW |