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

Commit b5402b27 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Remove workaround for unrotated gesture monitor (2/3)

There is currently a conflation between per-window-input-rotation and
unrotated gesture monitors. We would like to enable
per-widnow-input-rotation first without affecting gesture monitors so
that the old behavior is maintained for gesture monitors.

We can then add unrotated gesture monitors as a new feature later on.

Bug: 201982032
Bug: 179274888
Test: manual
Change-Id: I721ef278a9e0d9287e67b28e953b4ec4c4aea4e3
parent aa561d16
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -2541,24 +2541,9 @@ void InputDispatcher::addMonitoringTargetLocked(const Monitor& monitor, int32_t
    target.flags = InputTarget::FLAG_DISPATCH_AS_IS;
    ui::Transform t;
    if (const auto& it = mDisplayInfos.find(displayId); it != mDisplayInfos.end()) {
        // Input monitors always get un-rotated display coordinates. We undo the display
        // rotation that is present in the display transform so that display rotation is not
        // applied to these input targets.
        const auto& displayInfo = it->second;
        int32_t width = displayInfo.logicalWidth;
        int32_t height = displayInfo.logicalHeight;
        const auto orientation = displayInfo.transform.getOrientation();
        uint32_t inverseOrientation = orientation;
        if (orientation == ui::Transform::ROT_90) {
            inverseOrientation = ui::Transform::ROT_270;
            std::swap(width, height);
        } else if (orientation == ui::Transform::ROT_270) {
            inverseOrientation = ui::Transform::ROT_90;
            std::swap(width, height);
        }
        target.displayTransform =
                ui::Transform(inverseOrientation, width, height) * displayInfo.transform;
        t = t * target.displayTransform;
        const auto& displayTransform = it->second.transform;
        target.displayTransform = displayTransform;
        t = displayTransform;
    }
    target.setDefaultPointerTransform(t);
    inputTargets.push_back(target);