Add failing reproducer for show-taps overlay misplacement#4
Draft
takahirom wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproducer for #3, as requested (a runnable feedback loop for the show-taps overlay misplacement).
What this adds
ShowTapsOverlayPositionTest, intouchrobot-core.touchrobot-core(JUnit4, Robolectric 4.14.1,androidx.test.ext:junit,androidx.compose.ui:ui-test-junit4, andui-test-manifestasdebugImplementation), plustestOptions.unitTests.isIncludeAndroidResources = true. Versions go through the existing version catalog and match the Compose version the repo already uses (1.8.1).The Robolectric gotcha
rememberTouchRobot(showTaps = true)draws taps in a separate window added viaWindowManager.addView().MatchParentSizePopupsizes that window to the host view but leavesWindowManager.LayoutParams.gravityat its default (0), so WindowManager centers the window on screen. An overlay smaller than the screen is therefore drawn offset from the host view (and from the touches, which are injected at the host's top-left).Robolectric does not run WindowManager's window-placement math, so
View.getLocationOnScreen()reports(0, 0)for the overlay and hides the bug. The test instead reconstructs the on-screen rect with the exact call WindowManager makes to place a window —Gravity.apply(...)— and asserts the overlay lands at the host view's position.Current failure (on
trunk)This test fails intentionally on
trunk(that's the point — it's the red half of the feedback loop). The fix is stacked in the follow-up PR.