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

Unified Diff: views/focus/accelerator_handler_touch.cc

Issue 6242012: touch: Hide the X cursor when not in use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify Created 9 years, 11 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 | views/touchui/touch_factory.h » ('j') | views/touchui/touch_factory.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler_touch.cc
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc
index b24d8f09c33022f22096fe06d0344fa35107ce3c..af980b2e60e18953e30f5f8a44854ff0b75b3d82 100644
--- a/views/focus/accelerator_handler_touch.cc
+++ b/views/focus/accelerator_handler_touch.cc
@@ -62,18 +62,30 @@ bool X2EventIsTouchEvent(XEvent* xev) {
#if defined(HAVE_XINPUT2)
bool DispatchX2Event(RootView* root, XEvent* xev) {
+ XGenericEventCookie* cookie = &xev->xcookie;
+
if (X2EventIsTouchEvent(xev)) {
+ // Hide the cursor when a touch event comes in.
+ TouchFactory::GetInstance()->SetCursorVisibility(false);
+
// Create a TouchEvent, and send it off to |root|. If the event
// is processed by |root|, then return. Otherwise let it fall through so it
// can be used (if desired) as a mouse event.
-
TouchEvent touch(xev);
if (root->OnTouchEvent(touch) != views::View::TOUCH_STATUS_UNKNOWN)
return true;
+ } else {
+ // Make sure the cursor is visible when there is an event from a non-touch
+ // pointer device.
+ switch (cookie->evtype) {
+ case XI_ButtonPress:
+ case XI_ButtonRelease:
+ case XI_Motion:
+ TouchFactory::GetInstance()->SetCursorVisibility(true);
+ break;
+ }
}
- XGenericEventCookie* cookie = &xev->xcookie;
-
switch (cookie->evtype) {
case XI_KeyPress:
case XI_KeyRelease: {
« no previous file with comments | « no previous file | views/touchui/touch_factory.h » ('j') | views/touchui/touch_factory.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698