diff options
Diffstat (limited to 'services/java/com/android/server/WindowManagerService.java')
-rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index c603f20..3994c3b 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -6625,10 +6625,8 @@ public class WindowManagerService extends IWindowManager.Stub //Slog.i(TAG, "Read next event " + ev); dispatchPointer(ev, (MotionEvent)ev.event, 0, 0); if (mMouseDisplayed) { - Surface.openTransaction(); - mMouseSurface.hide(); - Surface.closeTransaction(); mMouseDisplayed = false; + requestAnimationLocked(0); } break; case RawInputEvent.CLASS_MOUSE: @@ -6636,30 +6634,12 @@ public class WindowManagerService extends IWindowManager.Stub int mcx = (int)mmev.getX(); int mcy = (int)mmev.getY(); - if (mMouseSurface != null && (mMlx != mcx || mMly != mcy)) { - Surface.openTransaction(); - if (DEBUG_INPUT) - Slog.i(TAG, "Open transaction for the mouse surface"); - WindowState top = - (WindowState)mWindows.get(mWindows.size() - 1); - try { - if (DEBUG_INPUT) - Slog.i(TAG, "Move surf, x: " + - Integer.toString(mcx) + " y:" - + Integer.toString(mcy)); - - mMouseSurface.setPosition(mcx, mcy); - mMouseSurface.setLayer(top.mAnimLayer + 1); - if (!mMouseDisplayed) { - mMouseSurface.show(); - mMouseDisplayed = true; - } - mMlx = mcx; - mMly = mcy; - } catch ( RuntimeException e) { - Slog.e(TAG, "Failure showing mouse surface",e); - } - Surface.closeTransaction(); + if (mMlx != mcx || mMly != mcy) { + mMlx = mcx; + mMly = mcy; + if (!mMouseDisplayed) + mMouseDisplayed = true; + requestAnimationLocked(0); } dispatchPointer(ev, (MotionEvent)ev.event, 0, 0); break; @@ -10737,6 +10717,27 @@ public class WindowManagerService extends IWindowManager.Stub mBlurShown = false; } + // FOURTH LOOP: Display Mouse + if (mMouseSurface != null) { + if (mMouseDisplayed) { + WindowState top = + (WindowState)mWindows.get(mWindows.size() - 1); + try { + if (DEBUG_INPUT) + Slog.i(TAG, "Move surf, x: " + + Integer.toString(mMlx) + " y:" + + Integer.toString(mMly)); + mMouseSurface.show(); + mMouseSurface.setPosition(mMlx, mMly); + mMouseSurface.setLayer(top.mAnimLayer + 1); + } catch (RuntimeException e) { + Slog.e(TAG, "Failure showing mouse surface", e); + } + } else { + mMouseSurface.hide(); + } + } + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); } catch (RuntimeException e) { Slog.e(TAG, "Unhandled exception in Window Manager", e); |