Skip to content
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

Inject main display events to the original display #5614

Merged
merged 2 commits into from
Dec 7, 2024
Merged

Conversation

rom1v
Copy link
Collaborator

@rom1v rom1v commented Dec 5, 2024

When mirroring a secondary display, touch and scroll events must be sent to the mirroring virtual display id (with coordinates relative to the virtual display size), rather than to the original display (with coordinates relative to the original display size). (see #4598 #5137)

This behavior, introduced by d193967 (#5370), was also applied for the main display for consistency. However, it has been found to cause some UI elements to become unclickable.

To minimize inconveniences, restore the previous behavior when mirroring the main display: send all events to the original display id (0) with coordinates relative to the original display size.

Fixes #5545
Fixes #5605

Here is a binary to replace in scrcpy 3.0.2:

  • scrcpy-server SHA-256: 350f96085b68f1bf5fd33cbf521ecec0c1b697048728a55d5ca402ab804a48b

@rodrigofd
Copy link

Cannot approve as I lack permissions, but manually tested it on behalf my #5605 and it fixed the issue completely 👍🏻

rom1v added 2 commits December 7, 2024 20:08
When mirroring a secondary display, touch and scroll events must be sent
to the mirroring virtual display id (with coordinates relative to the
virtual display size), rather than to the original display (with
coordinates relative to the original display size).

This behavior, introduced by d193967,
was also applied for the main display for consistency. However, it
causes some UI elements to become unclickable.

To minimize inconveniences, restore the previous behavior when mirroring
the main display: send all events to the original display id (0) with
coordinates relative to the original display size.

Fixes #5545 <#5545>
Fixes #5605 <#5605>
Fixes #5616 <#5616>
Refs #4598 <#4598>
Refs #5137 <#5137>
Refs #5370 <#5370>
PR #5614 <#5614>
Following the changes from the previous commit, the behavior is now
identical when mirroring the main display or using the SurfaceControl
API.

Factorize the code to perform the initialization in a single location.

Refs #5605 <#5605>
PR #5614 <#5614>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants