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

Can not control virtual display with mouse when phone screen dims #5529

Open
beginor opened this issue Nov 25, 2024 · 4 comments
Open

Can not control virtual display with mouse when phone screen dims #5529

beginor opened this issue Nov 25, 2024 · 4 comments

Comments

@beginor
Copy link

beginor commented Nov 25, 2024

Environment

Describe the bug

Create a virtual display with scrcpy 3.0:

./scrcpy --new-display=1920x1080 --start-app com.android.chrome

At first, touch control with mouse works, but when the phone screen dims after a while, the virtual display can't be controled by mouse, but keyboard works.

Console output is:

./scrcpy --new-display=1920x1080 --start-app com.android.chrome --turn-screen-off
scrcpy 3.0 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  faa6391a                        device  22021211RC
./scrcpy-server: 1 file pushed, 0 skipped. 256.2 MB/s (90224 bytes in 0.000s)
[server] INFO: Device: [Xiaomi] Redmi 22021211RC (Android 14)
INFO: Renderer: metal
INFO: Texture: 1920x1080
[server] INFO: New display: 1920x1080/352 (id=25)
[server] INFO: Starting app "Chrome" [com.android.chrome] on display 25...
2024-11-25 12:05:38.092 scrcpy_bin[61055:2185348] +[IMKClient subclass]: chose IMKClient_Modern
2024-11-25 12:05:38.092 scrcpy_bin[61055:2185348] +[IMKInputSession subclass]: chose IMKInputSession_Modern
@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2024

It depends on the device.

On a Pixel 8, I can open a virtual display without even turning the physical screen on.

As a workaround, you can probably use the new --screen-off-timeout option (or the old --stay-awake if plugged on USB) and turn the physical screen off with #5522.

@rom1v
Copy link
Collaborator

rom1v commented Nov 25, 2024

Does it also happen with main screen mirroring with --turn-screen-off?

@razielaka
Copy link

I tested this on my setup (Windows 11 and a Xiaomi phone running Android 13 connected via USB) with main screen mirroring. When the phone screen times out, the lock screen appears, and the mouse still works. However, I can't unlock the phone because the pattern unlock screen doesn’t appear, and the under-screen fingerprint reader isn’t functional in this mode. The mouse issue arises only with the virtual screen after the main screen times out, not with the mirrored main screen. The keyboard continues to function normally in both modes.

@Kitsunejasutin
Copy link

I was recently testing the virtual display on my pixel 7, it works well and surprisingly no issues if you started the display and continuously using the display with the device screen off. However, if you try to switch application on your computer, after coming back to the window, the screen won't respond on your mouse clicks. Keyboard still works though.

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

No branches or pull requests

4 participants