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

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/test/event_generator.cc » ('j') | no next file with comments »
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..34888e097bc9b98574d902a68c2ec65be872b39c 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -398,6 +398,12 @@ 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());
+ }
oshima 2014/02/11 19:43:38 This was necessary because EnterOrExit may cause e
sadrul 2014/02/11 21:26:20 Can you explain this a bit more? The early returns
+
if (!mouse_moved_handler_ || !mouse_moved_handler_->delegate())
return DispatchDetails();
@@ -793,7 +799,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,
@@ -811,10 +816,11 @@ void RootWindow::PreDispatchLocatedEvent(Window* target,
if (!dispatching_held_event_ &&
(event->IsMouseEvent() || event->IsScrollEvent())) {
- if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)
- SetLastMouseLocation(window(), event->root_location());
- if (!(event->flags() & ui::EF_IS_SYNTHESIZED))
+ if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) {
sadrul 2014/02/13 04:38:59 Merge the two if's?
oshima 2014/02/13 15:25:32 Done.
+ if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)
+ SetLastMouseLocation(window(), event->root_location());
synthesize_mouse_move_ = false;
+ }
}
}
« no previous file with comments | « no previous file | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698