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

Commit fcc08525 authored by Robert Carr's avatar Robert Carr
Browse files

Forward SurfaceInsets to InputWindowInfo

So that SurfaceFlinger can set the appropriate frame. See
frameworks/native commit and InputWindow.h for detailed
discussion.

Test: Manual
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I5df12fa3f90335f2045ee7107d3b1242ff0d00c5
parent 0bcbe644
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ public final class InputWindowHandle {
    public int frameRight;
    public int frameBottom;

    public int surfaceInset;

    // Global scaling factor applied to touch events when they are dispatched
    // to the window
    public float scaleFactor;
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ static struct {
    jfieldID frameTop;
    jfieldID frameRight;
    jfieldID frameBottom;
    jfieldID surfaceInset;
    jfieldID scaleFactor;
    jfieldID touchableRegion;
    jfieldID visible;
@@ -117,6 +118,8 @@ bool NativeInputWindowHandle::updateInfo() {
            gInputWindowHandleClassInfo.frameRight);
    mInfo.frameBottom = env->GetIntField(obj,
            gInputWindowHandleClassInfo.frameBottom);
    mInfo.surfaceInset = env->GetIntField(obj,
            gInputWindowHandleClassInfo.surfaceInset);
    mInfo.scaleFactor = env->GetFloatField(obj,
            gInputWindowHandleClassInfo.scaleFactor);

@@ -266,6 +269,9 @@ int register_android_server_InputWindowHandle(JNIEnv* env) {
    GET_FIELD_ID(gInputWindowHandleClassInfo.frameBottom, clazz,
            "frameBottom", "I");

    GET_FIELD_ID(gInputWindowHandleClassInfo.surfaceInset, clazz,
            "surfaceInset", "I");

    GET_FIELD_ID(gInputWindowHandleClassInfo.scaleFactor, clazz,
            "scaleFactor", "F");

+5 −0
Original line number Diff line number Diff line
@@ -215,6 +215,11 @@ final class InputMonitor {
        inputWindowHandle.frameRight = frame.right;
        inputWindowHandle.frameBottom = frame.bottom;

        // Surface insets are hardcoded to be the same in all directions
        // and we could probably deprecate the "left/right/top/bottom" concept.
        // we avoid reintroducing this concept by just choosing one of them here.
        inputWindowHandle.surfaceInset = child.getAttrs().surfaceInsets.left;

        if (child.mGlobalScale != 1) {
            // If we are scaling the window, input coordinates need
            // to be inversely scaled to map from what is on screen