Add virtual display feature by rom1v · Pull Request #5370 · Genymobile/scrcpy (original) (raw)

This was referenced

Oct 12, 2024

This was referenced

Oct 12, 2024

@biomagnet mentioned this pull request

Oct 19, 2024

1 task

rom1v added a commit that referenced this pull request

Dec 5, 2024

@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 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 <#5545> Fixes #5605 <#5605> Refs #4598 <#4598> Refs #5137 <#5137> Refs #5370 <#5370>

@rom1v rom1v mentioned this pull request

Dec 5, 2024

rom1v added a commit that referenced this pull request

Dec 7, 2024

@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 rom1v mentioned this pull request

Dec 11, 2024

This was referenced

Jan 27, 2025

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

Apr 11, 2025

@rom1v

Move the code related to screen size and rotation/fold to ScreenCapture.

For now, keep the ScreenInfo instance in the Device class to communicate with the Controller, but it will be removed by further commits.

PR Genymobile#5370 <Genymobile#5370>

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

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

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

Apr 11, 2025

@rom1v

Add a function called before each capture starts (before getSize() is called).

This allows to compute the ScreenInfo instance once exactly when needed.

PR Genymobile#5370 <Genymobile#5370>

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

Apr 11, 2025

@rom1v

Remove from Device the functions using an implicit displayId.

Move them to Controller, which knows best which displayId it must use.

This will allow to properly dispatch events either to the origin display or to the virtual display created for mirroring.

PR Genymobile#5370 <Genymobile#5370>

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

Extract the function that converts coordinates from video space to display space into a separate component.

It only requires the specific data it uses and does not need a full ScreenInfo object (although it can be created from a ScreenInfo instance).

PR Genymobile#5370 <Genymobile#5370>

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

Apr 11, 2025

@rom1v

When a new capture starts, send a new PositionMapper to the Controller without using the global Device as an intermediate.

Now all Device methods are static.

PR Genymobile#5370 <Genymobile#5370>

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

Apr 11, 2025

@rom1v @Laurie-Lin

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

Add a feature to create a new (separate) virtual display instead of mirroring the device screen:

scrcpy --new-display=1920x1080
scrcpy --new-display=1920x1080/420  # force 420 dpi
scrcpy --new-display         # use the main display size and density
scrcpy --new-display -m1920  # scaled to fit a max size of 1920
scrcpy --new-display=/240    # use the main display size and 240 dpi

Fixes Genymobile#1887 <Genymobile#1887> PR Genymobile#5370 <Genymobile#5370>

Co-authored-by: Simon Chan 1330321+yume-chan@users.noreply.github.com Co-authored-by: anirudhb anirudhb@users.noreply.github.com

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

@rom1v rom1v mentioned this pull request

Jan 27, 2026

1 task

@rom1v rom1v mentioned this pull request

Apr 23, 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

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