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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 237893002: Fix behavior of WindowEventDispatcher::SynthesizeMouseMoveEvent(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synthesize DRAGGED events when mouse button is down. Add more unit tests. Created 6 years, 8 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
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index c566d1b58ea3337d197801a895a99b6610f52a0e..deedeca66184a3080b6b3aa716e81dbea6b76e37 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -594,7 +594,7 @@ void WindowEventDispatcher::OnWindowBoundsChanged(Window* window,
synthesize_mouse_move_ = false;
}
- if (window->IsVisible()) {
+ if (window->IsVisible() && !window->ignore_events()) {
gfx::Rect old_bounds_in_root = old_bounds, new_bounds_in_root = new_bounds;
Window::ConvertRectToTarget(window->parent(), host_->window(),
&old_bounds_in_root);
@@ -698,10 +698,16 @@ ui::EventDispatchDetails WindowEventDispatcher::SynthesizeMouseMoveEvent() {
return details;
gfx::Point host_mouse_location = root_mouse_location;
host_->ConvertPointToHost(&host_mouse_location);
- ui::MouseEvent event(ui::ET_MOUSE_MOVED,
+ ui::EventType event_type = ui::ET_MOUSE_MOVED;
+ int flags = ui::EF_IS_SYNTHESIZED;
+ if (Env::GetInstance()->IsMouseButtonDown()) {
+ event_type = ui::ET_MOUSE_DRAGGED;
+ flags |= Env::GetInstance()->mouse_button_flags();
+ }
+ ui::MouseEvent event(event_type,
host_mouse_location,
host_mouse_location,
- ui::EF_IS_SYNTHESIZED,
+ flags,
0);
return OnEventFromSource(&event);
}

Powered by Google App Engine
This is Rietveld 408576698