Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: ui/aura/root_window.cc

Issue 143303006: Do not set the last mouse location from synthesized event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | ui/aura/root_window_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 128a04424d45ae084e9b6ecfbd659e1d1b42979a..332a88999ac77470ac9d922f9d24a44c5079965d 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -398,6 +398,11 @@ void RootWindow::MoveCursorToInternal(const gfx::Point& root_location,
ui::EventDispatchDetails RootWindow::DispatchMouseEnterOrExit(
const ui::MouseEvent& event,
ui::EventType type) {
+ if (event.type() != ui::ET_MOUSE_CAPTURE_CHANGED &&
+ !(event.flags() & ui::EF_IS_SYNTHESIZED)) {
+ SetLastMouseLocation(window(), event.root_location());
+ }
+
if (!mouse_moved_handler_ || !mouse_moved_handler_->delegate())
return DispatchDetails();
@@ -793,7 +798,6 @@ ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() {
return details;
gfx::Point host_mouse_location = root_mouse_location;
host()->ConvertPointToHost(&host_mouse_location);
-
ui::MouseEvent event(ui::ET_MOUSE_MOVED,
host_mouse_location,
host_mouse_location,
@@ -810,11 +814,11 @@ void RootWindow::PreDispatchLocatedEvent(Window* target,
event->set_flags(flags);
if (!dispatching_held_event_ &&
- (event->IsMouseEvent() || event->IsScrollEvent())) {
+ (event->IsMouseEvent() || event->IsScrollEvent()) &&
+ !(event->flags() & ui::EF_IS_SYNTHESIZED)) {
if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)
SetLastMouseLocation(window(), event->root_location());
- if (!(event->flags() & ui::EF_IS_SYNTHESIZED))
- synthesize_mouse_move_ = false;
+ synthesize_mouse_move_ = false;
}
}
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | ui/aura/root_window_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698