New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LocalUiController does not inject events to the correct Window #6741
Comments
It is also useful for multi-window occasion, including split screen and freeform. From network information, there are so many fold and tablets devices will leverage split screen to enhance Android experience, and in my opinion supporting for those occasion is very important for The |
👍 to adding some heuristics to LocalUiController to select a more appropriate window. @wesalvaro would you be able to send a PR for that change? |
PiperOrigin-RevId: 399115715
lol. I'm not sure what's up with that copybara patch. |
If you add your Google email to your GitHub account, I think the GitHub will show you as author. What I learnt from those copybara PRs is that it will copy and send a PR if internal has a commit, and it contains previous commits copied by copybara to And @wesalvaro could you add |
@wesalvaro sorry about that, the way we use Copybara is totally broken. The PRs from copybra are effectively meaningless, it displays the last N commits since the last time Google contributions are synced to GitHub. It is high on our TODO list to improve this situation. |
@utzcoz |
@wesalvaro https://github.com/robolectric/robolectric/commit/52cc2fd6832f723fc33530250501fbd328c6b1f6.patch from this commit message, it shows author is Googler noreply@google.com. Maybe it is a problem of copybara. If the author email is your linked emails at GitHub account, it will show you at GitHub commit page and other locations at GitHub. |
@utzcoz Maybe it's because that's a compound patch with more than just my change? |
PiperOrigin-RevId: 399115715
PiperOrigin-RevId: 399115715
PiperOrigin-RevId: 399115715
Check Window flags when selecting root view in LocalUiController. #6741
@wesalvaro Looks like related PR is merged. I will close this issue. If you have any problem about it, feel free to reopen it. Thanks. |
Description
LocalUiController
always selects the top-mostWindow
to deliverMotionEvent
s andKeyEvent
s. The top-mostWindow
is not the correct heuristic to use as it can be non-interactable. This creates confusing issues when interacting with the main application when a tooltip-likePopupWindow
is showing. Events seem to simply disappear/never be delivered.I would propose improving the heuristic in the
LocalUiController
. At least to take into account theWindow
flags (e.g.FLAG_NOT_TOUCHABLE
andFLAG_NOT_FOCUSABLE
). Ideally we could further look at whichWindow
should receive the event; theWindowManager.LayoutParams
do contain location and sizing information but that would require measuring theWindow
contents (as in the case ofWRAP_CONTENT
).The current workaround is to:
UiController
that may look like:ViewAction
that may look like:Steps to Reproduce
PopupWindow
.Window
:Expected: Click is delivered to the main application
Window
Observed: Click is delivered to the
PopupWindow
The same can be said for a variety of situations.
Robolectric & Android Version
Current Robolectric.
Android Version does not apply.
Link to a public git repo demonstrating the problem:
Internal b/199994449 has more details, discussion, and examples.
The text was updated successfully, but these errors were encountered: