Inject main display events to the original display by rom1v · Pull Request #5614 · Genymobile/scrcpy (original) (raw)

This was referenced

Dec 5, 2024

added 2 commits

December 7, 2024 20:08

@rom1v

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>

@rom1v

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>

@rom1v rom1v mentioned this pull request

Dec 8, 2024

bartsaintgermain pushed a commit to bartsaintgermain/scrcpy that referenced this pull request

Apr 11, 2025

@rom1v

bartsaintgermain pushed a commit to bartsaintgermain/scrcpy that referenced this pull request

Apr 11, 2025

@rom1v

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

[ Show hidden characters]({{ revealButtonHref }})