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

Issue with --turn-screen-off command #5907

Open
Kavinesh123 opened this issue Mar 6, 2025 · 1 comment
Open

Issue with --turn-screen-off command #5907

Kavinesh123 opened this issue Mar 6, 2025 · 1 comment

Comments

@Kavinesh123
Copy link

Please read the prerequisites to run scrcpy.

Also read the FAQ and check if your issue already exists.

Environment

  • OS: Windows
  • Scrcpy version: 3.1
  • Installation method: Using git clone command
  • Device model: Samsung Galaxy M31 SM-M315F/DS
  • Android version: 12

Describe the bug

When I start scrcpy using the --turn-screen-off command while my phone is unlocked, the phone's screen turns off as expected, and I can see the display on my laptop. However, if I physically lock my phone using the power button the screen is still turned off (that's not an issue), but if I press the power button again to wake it, the phone screen lights up and shows the lock screen. This also happens in the following scenarios:

  1. If the phone is already locked, then unlocked, and locked again, pressing the power button turns the screen on.

  2. If I manually press the power button after locking the phone, the screen turns on unexpectedly.

Interestingly, if I lock my phone using scrcpy (my phone has a feature where double-tapping the screen turns it off), and then again wake it again using scrcpy by right clicking the screen does not turn on the screen.

Expected Behavior: The phone screen should remain off when using --turn-screen-off mode, even if the power button is pressed.

@rom1v
Copy link
Collaborator

rom1v commented Mar 6, 2025

The phone screen should remain off when using --turn-screen-off mode, even if the power button is pressed.

To turn the screen off, scrcpy set the "power mode" to off. This power mode is automatically changed by Android if you press the power button, out of control of scrcpy.

If you "press" POWER via MOD+p or right click via scrcpy, as a best effort, the power mode is reset to off: #1573 #1577.

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

2 participants