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

Commit 266d0d0f authored by Lior Barenboim's avatar Lior Barenboim
Browse files

Ultrasound: Fix off-screen display window frame size overwrite

In certain scenarios, the frame size of a window which resides in
the off-screen display could have been overwritten by the frame
size of a window in the main display.

This fix uses a fresh Rect object for the queried frame size to
make sure it does not get overwritten.

Change-id: I06ad85fd197f41de0adecaa25e306ec6bf6e6290
parent 72aab106
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -182,6 +182,8 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
            DisplayContent offScreenDisplayContent =
                mService.getDigitalPenOffScreenDisplayContentLocked();

            Rect touchableRegion = new Rect();

            if ((!DigitalPenOffScreenDisplayAdapter.isDigitalPenDisabled())
                && (null != offScreenDisplayContent)
                && (child.getDisplayId() == offScreenDisplayContent.getDisplayId())) {
@@ -189,11 +191,11 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
                // display, make the touchable region the entire frame. Using
                // getStackBounds() will yield the bounds of the activity which
                // is on the main display - not what we want.
                mTmpRect = child.getFrameLw();
                touchableRegion = child.getFrameLw();
            } else {
                child.getStackBounds(mTmpRect);
                child.getStackBounds(touchableRegion);
            }
            inputWindowHandle.touchableRegion.set(mTmpRect);
            inputWindowHandle.touchableRegion.set(touchableRegion);
        } else {
            // Not modal or full screen modal
            child.getTouchableRegion(inputWindowHandle.touchableRegion);