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

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 10835047: Allow the cursor to warp even when a window is dragged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style fix Created 8 years, 4 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 | « ash/display/display_controller.cc ('k') | ash/display/screen_position_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mouse_cursor_event_filter.cc
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index 9b6d2973cde40375253e5cd909298ce5305d84bc..c103f087c5e30c5701f4c563ea465e845ac1af82 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -31,9 +31,14 @@ bool MouseCursorEventFilter::PreHandleKeyEvent(aura::Window* target,
bool MouseCursorEventFilter::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
- if (event->type() != ui::ET_MOUSE_MOVED ||
- ash::Shell::GetInstance()->cursor_manager()->is_cursor_locked())
- return false;
+ // Handle both MOVED and DRAGGED events here because when the mouse pointer
+ // enters the other root window while dragging, the underlying window system
+ // (at least X11) stops generating a ui::ET_MOUSE_MOVED event.
+ if (event->type() != ui::ET_MOUSE_MOVED &&
+ event->type() != ui::ET_MOUSE_DRAGGED) {
+ return false;
+ }
+
aura::RootWindow* current_root = target->GetRootWindow();
gfx::Point location_in_root(event->location());
aura::Window::ConvertPointToWindow(target, current_root, &location_in_root);
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/screen_position_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698