summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/input/DisplayTopologyGraph.h3
-rw-r--r--services/inputflinger/PointerChoreographer.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/include/input/DisplayTopologyGraph.h b/include/input/DisplayTopologyGraph.h
index 90427bd76d..f3f5148540 100644
--- a/include/input/DisplayTopologyGraph.h
+++ b/include/input/DisplayTopologyGraph.h
@@ -43,7 +43,7 @@ enum class DisplayTopologyPosition : int32_t {
struct DisplayTopologyAdjacentDisplay {
ui::LogicalDisplayId displayId = ui::LogicalDisplayId::INVALID;
DisplayTopologyPosition position;
- float offsetPx;
+ float offsetDp;
};
/**
@@ -52,6 +52,7 @@ struct DisplayTopologyAdjacentDisplay {
struct DisplayTopologyGraph {
ui::LogicalDisplayId primaryDisplayId = ui::LogicalDisplayId::INVALID;
std::unordered_map<ui::LogicalDisplayId, std::vector<DisplayTopologyAdjacentDisplay>> graph;
+ std::unordered_map<ui::LogicalDisplayId, int> displaysDensity;
};
} // namespace android
diff --git a/services/inputflinger/PointerChoreographer.cpp b/services/inputflinger/PointerChoreographer.cpp
index 5bf6ebbb46..9f9128529d 100644
--- a/services/inputflinger/PointerChoreographer.cpp
+++ b/services/inputflinger/PointerChoreographer.cpp
@@ -1017,9 +1017,9 @@ PointerChoreographer::findDestinationDisplayLocked(const ui::LogicalDisplayId so
sourceBoundary == DisplayTopologyPosition::BOTTOM
? (destinationViewport->logicalRight - destinationViewport->logicalLeft)
: (destinationViewport->logicalBottom - destinationViewport->logicalTop);
- if (cursorOffset >= adjacentDisplay.offsetPx &&
- cursorOffset <= adjacentDisplay.offsetPx + edgeSize) {
- return std::make_pair(destinationViewport, adjacentDisplay.offsetPx);
+ if (cursorOffset >= adjacentDisplay.offsetDp &&
+ cursorOffset <= adjacentDisplay.offsetDp + edgeSize) {
+ return std::make_pair(destinationViewport, adjacentDisplay.offsetDp);
}
}
return std::nullopt;