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

Unified Diff: ash/display/mouse_cursor_event_filter.cc

Issue 10826005: Don't warp mouse if the cursor is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/cursor_manager.h » ('j') | ui/aura/cursor_manager.cc » ('J')
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 0ab6f1cff0e09c1580095415b8ae1cf8c11c2050..0dc3f042646bdc20e5ca01897f2a8c5f2d395f71 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -5,6 +5,8 @@
#include "ash/display/mouse_cursor_event_filter.h"
#include "ash/display/display_controller.h"
+#include "ui/aura/cursor_manager.h"
+#include "ui/aura/env.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -28,7 +30,8 @@ bool MouseCursorEventFilter::PreHandleKeyEvent(aura::Window* target,
bool MouseCursorEventFilter::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
- if (event->type() != ui::ET_MOUSE_MOVED)
+ if (event->type() != ui::ET_MOUSE_MOVED ||
+ aura::Env::GetInstance()->cursor_manager()->IsCursorLocked())
return false;
aura::RootWindow* current_root = target->GetRootWindow();
gfx::Point location_in_root(event->location());
« no previous file with comments | « no previous file | ui/aura/cursor_manager.h » ('j') | ui/aura/cursor_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698