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

Unified Diff: ui/aura/shared/compound_event_filter.cc

Issue 10831135: aura: Fix hiding the cursor on touch events. (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 | « ui/aura/shared/compound_event_filter.h ('k') | ui/aura/shared/compound_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/shared/compound_event_filter.cc
diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc
index 4bc8866eb8e99934dd2eb86f9bbb6a819142bc5d..85cff86fe141c3e6c7ca7d316cc2fc42aac35ebc 100644
--- a/ui/aura/shared/compound_event_filter.cc
+++ b/ui/aura/shared/compound_event_filter.cc
@@ -103,7 +103,7 @@ bool CompoundEventFilter::PreHandleMouseEvent(aura::Window* target,
if (event->type() == ui::ET_MOUSE_MOVED ||
event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_MOUSEWHEEL) {
- SetVisibilityOnEvent(target, event, true);
+ SetCursorVisibilityOnEvent(target, event, true);
UpdateCursor(target, event);
}
@@ -125,7 +125,12 @@ bool CompoundEventFilter::PreHandleMouseEvent(aura::Window* target,
ui::TouchStatus CompoundEventFilter::PreHandleTouchEvent(
aura::Window* target,
aura::TouchEvent* event) {
- return FilterTouchEvent(target, event);
+ ui::TouchStatus status = FilterTouchEvent(target, event);
+ if (status == ui::TOUCH_STATUS_UNKNOWN &&
+ event->type() == ui::ET_TOUCH_PRESSED) {
+ SetCursorVisibilityOnEvent(target, event, false);
+ }
+ return status;
}
ui::GestureStatus CompoundEventFilter::PreHandleGestureEvent(
@@ -145,7 +150,6 @@ ui::GestureStatus CompoundEventFilter::PreHandleGestureEvent(
event->details().touch_points() == 1 &&
target->GetRootWindow() &&
GetActiveWindow(target) != target) {
- SetVisibilityOnEvent(target, event, false);
target->GetFocusManager()->SetFocusedWindow(
FindFocusableWindowFor(target), event);
}
@@ -211,9 +215,9 @@ ui::TouchStatus CompoundEventFilter::FilterTouchEvent(
return status;
}
-void CompoundEventFilter::SetVisibilityOnEvent(aura::Window* target,
- aura::LocatedEvent* event,
- bool show) {
+void CompoundEventFilter::SetCursorVisibilityOnEvent(aura::Window* target,
+ aura::LocatedEvent* event,
+ bool show) {
if (update_cursor_visibility_ && !(event->flags() & ui::EF_IS_SYNTHESIZED)) {
aura::client::CursorClient* client =
aura::client::GetCursorClient(target->GetRootWindow());
« no previous file with comments | « ui/aura/shared/compound_event_filter.h ('k') | ui/aura/shared/compound_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698