Skip to content

Commit 075f263

Browse files
Piotr WilczyńskiAndroid (Google) Code Review
authored andcommitted
Merge "DisplayTopologyGraph offset in dp and store densities" into main
2 parents da025e5 + 67c5323 commit 075f263

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

include/input/DisplayTopologyGraph.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ enum class DisplayTopologyPosition : int32_t {
4343
struct DisplayTopologyAdjacentDisplay {
4444
ui::LogicalDisplayId displayId = ui::LogicalDisplayId::INVALID;
4545
DisplayTopologyPosition position;
46-
float offsetPx;
46+
float offsetDp;
4747
};
4848

4949
/**
@@ -52,6 +52,7 @@ struct DisplayTopologyAdjacentDisplay {
5252
struct DisplayTopologyGraph {
5353
ui::LogicalDisplayId primaryDisplayId = ui::LogicalDisplayId::INVALID;
5454
std::unordered_map<ui::LogicalDisplayId, std::vector<DisplayTopologyAdjacentDisplay>> graph;
55+
std::unordered_map<ui::LogicalDisplayId, int> displaysDensity;
5556
};
5657

5758
} // namespace android

services/inputflinger/PointerChoreographer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,9 @@ PointerChoreographer::findDestinationDisplayLocked(const ui::LogicalDisplayId so
10171017
sourceBoundary == DisplayTopologyPosition::BOTTOM
10181018
? (destinationViewport->logicalRight - destinationViewport->logicalLeft)
10191019
: (destinationViewport->logicalBottom - destinationViewport->logicalTop);
1020-
if (cursorOffset >= adjacentDisplay.offsetPx &&
1021-
cursorOffset <= adjacentDisplay.offsetPx + edgeSize) {
1022-
return std::make_pair(destinationViewport, adjacentDisplay.offsetPx);
1020+
if (cursorOffset >= adjacentDisplay.offsetDp &&
1021+
cursorOffset <= adjacentDisplay.offsetDp + edgeSize) {
1022+
return std::make_pair(destinationViewport, adjacentDisplay.offsetDp);
10231023
}
10241024
}
10251025
return std::nullopt;

0 commit comments

Comments
 (0)