[PATCH] frameworks/base: WindowManagerService: Hide mouse cursor on touchevent

163 views
Skip to first unread message

Kan-Ru Chen

unread,
Jul 13, 2010, 2:36:46 AM7/13/10
to Cyanogen (Steve Kondik), 0xlab...@googlegroups.com, Kan-Ru Chen
Change-Id: I6c719de7c0473d65451f13fad1e5c37f08755596
---
.../com/android/server/WindowManagerService.java | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index cc76d8f..a557227 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -392,7 +392,7 @@ public class WindowManagerService extends IWindowManager.Stub
boolean mBlurShown;

Surface mMouseSurface;
- int mShowMouse = 0;
+ boolean mMouseDisplayed = false;
int mMlx;
int mMly;
int mMlw;
@@ -6613,6 +6613,12 @@ public class WindowManagerService extends IWindowManager.Stub
case RawInputEvent.CLASS_TOUCHSCREEN:
//Slog.i(TAG, "Read next event " + ev);
dispatchPointer(ev, (MotionEvent)ev.event, 0, 0);
+ if (mMouseDisplayed) {
+ Surface.openTransaction();
+ mMouseSurface.hide();
+ Surface.closeTransaction();
+ mMouseDisplayed = false;
+ }
break;
case RawInputEvent.CLASS_MOUSE:
MotionEvent mmev = (MotionEvent)ev.event;
@@ -6633,9 +6639,9 @@ public class WindowManagerService extends IWindowManager.Stub

mMouseSurface.setPosition(mcx, mcy);
mMouseSurface.setLayer(top.mAnimLayer + 1);
- if (mShowMouse != 1) {
+ if (!mMouseDisplayed) {
mMouseSurface.show();
- mShowMouse = 1;
+ mMouseDisplayede = true;
}
mMlx = mcx;
mMly = mcy;
--
1.7.1

Reply all
Reply to author
Forward
0 new messages