Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d4022f4 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "Fix HID support on orientation change."

This reverts commit 1acb2fba.
parent e5aa5f75
Loading
Loading
Loading
Loading
+47 −65
Original line number Diff line number Diff line
@@ -6635,10 +6635,7 @@ public class WindowManagerService extends IWindowManager.Stub
                                MotionEvent mmev = (MotionEvent)ev.event;
                                int mcx = (int)mmev.getX();
                                int mcy = (int)mmev.getY();
                                if(mMlx < 0 || mMly < 0) {
                                    mMlx = mDisplay.getWidth()/2;
                                    mMly = mDisplay.getHeight()/2;
                                }

                                if (mMouseSurface != null && (mMlx != mcx || mMly != mcy)) {
                                    Surface.openTransaction();
                                    if (DEBUG_INPUT)
@@ -6651,29 +6648,14 @@ public class WindowManagerService extends IWindowManager.Stub
                                                  Integer.toString(mcx) + " y:"
                                                  + Integer.toString(mcy));

                                        mMlx = mcx;
                                        mMly = mcy;

                                        switch (mDisplay.getOrientation()) {
                                            case Surface.ROTATION_0:
                                                mMouseSurface.setPosition(mMlx, mMly);
                                                break;
                                            case Surface.ROTATION_90:
                                                mMouseSurface.setPosition(mDisplay.getHeight() - mMly, mMlx);
                                                break;
                                            case Surface.ROTATION_180:
                                                mMouseSurface.setPosition(mDisplay.getWidth() - mMlx, mDisplay.getHeight()- mMly);
                                                break;
                                            case Surface.ROTATION_270:
                                                mMouseSurface.setPosition(mMly, mDisplay.getWidth()- mMlx);
                                                break;
                                        }

                                        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);
                                    }